使用SubGit将Git存储库转换为SVN [英] Converting Git repository into SVN with SubGit

查看:129
本文介绍了使用SubGit将Git存储库转换为SVN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SubGit 来同步Git和SVN回购。克隆远程Git仓库时,我想保留所有仓库的历史记录。我现在遵循的步骤只允许我复制master分支的历史记录:

  svnadmin create svn_repos 
subgit- 1.0.0-EAP_1381 / bin / subgit configure svn_repos
subgit-1.0.0 -EAP_1381 / bin / subgit install svn_repos
git clone svn_repos gitRepo

cd gitRepo /
git remote add -f newRemote git://127.0.0.1/gitRepo
...
从git://127.0.0.1/gitRepo
* [new branch] FirstProductionTag - > newRemote / FirstProductionTag
* [new branch] SecondProductionTag - > newRemote / SecondProductionTag
* [new branch] ThirdProductionTag - > newRemote / ThirdProductionTag
* [新分支] bugfix - > newRemote / bugfix
* [new branch] bugfix2 - > newRemote / bugfix2
* [new branch] master - > newRemote / master

git merge -s我们的--no-commit newRemote / master
git读取树--prefix = foo / bar / -u newRemote / master
git提交-m合并新的远程到子目录/ foo / bar
git push origin master

我该如何合并来自bugfix和bugfix2分支的更改?如果您的目标是从远程Git存储库获取Subversion存储库并同时保持两个存储库同步,请考虑执行以下操作:1 2 3 4 5 6 7 8 9 10

  $ svnadmin create svn_repos 
$ git clone --mirror git://127.0.0.1/gitRepo svn_repos /。 git
$ subgit-1.0.0 -EAP_1381 / bin / subgit install svn_repos


I am using SubGit to synchronize Git and SVN repos. When cloning a remote Git repo I want to preserve all the history of that repo. The steps I currently follow allow me to copy the history of the master branch only:

svnadmin create svn_repos
subgit-1.0.0-EAP_1381/bin/subgit configure svn_repos
subgit-1.0.0-EAP_1381/bin/subgit install svn_repos
git clone svn_repos gitRepo

cd gitRepo/
git remote add -f newRemote git://127.0.0.1/gitRepo
...
From git://127.0.0.1/gitRepo
 * [new branch]      FirstProductionTag -> newRemote/FirstProductionTag
 * [new branch]      SecondProductionTag -> newRemote/SecondProductionTag
 * [new branch]      ThirdProductionTag -> newRemote/ThirdProductionTag
 * [new branch]      bugfix     -> newRemote/bugfix
 * [new branch]      bugfix2    -> newRemote/bugfix2
 * [new branch]      master     -> newRemote/master

git merge -s ours --no-commit newRemote/master
git read-tree --prefix=foo/bar/ -u newRemote/master 
git commit -m "Merged new Remote into subdirectory /foo/bar"
git push origin master

How can I merge the changes from bugfix and bugfix2 branches at the same time? Thanks!

解决方案

If your goal is to get Subversion repository from remote Git repository and keep both repositories synchronized, consider do the following:

$ svnadmin create svn_repos
$ git clone --mirror git://127.0.0.1/gitRepo svn_repos/.git
$ subgit-1.0.0-EAP_1381/bin/subgit install svn_repos

这篇关于使用SubGit将Git存储库转换为SVN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆