当必须使用Git和Subversion时如何处理Git-svn [英] How to deal with Git-svn when have to use both Git and Subversion
问题描述
[问题]
我在使用Subversion作为存储库的组织中,因此将其转储为我的个人Git(并计划在未来将Git替换为Subversion)
现在,我拥有使用 Git 和 Subversion(主要来源)的存储库。当我必须同时使用git和subversion时,我遇到了处理 git svn rebase 的问题。
我的工作流如下
> 在办公室
- 存储库具有Git-svn接口
- 我总是通过 svn dcommit 从此处将代码提交给Subversion。
- 我在Bitbucket中推送到远程git存储库
在家
- 我从Bitbucket中克隆存储库
- 使用并提交Bitbucket
现在,回到OFfice
- git pull
- git svn rebase
- git svn dcommit
- git push
在步骤4我有一个问题,我已经重新戴上了我的胸罩nch
当我回家时,问题现在出现
回家后,我不能使用'git fetch',因为该分支已经重新发行。所以,我必须再次使用 git branch -D ..... 和 git checkout 移除分支。
<因此,我寻找可以同时使用Git存储库和Subversion的方式,并且在使用
注意。我不会在家使用任何 git-svn 。尝试仅使用Git。
从使用Git进行版本控制一书。
不使用本地主分支,而必须检出远程分支
git checkout remote / master(Detach HEAD)
git merge --no-ff master(merge the local master)
git svn dcommit
git push origin(update to git仓库)
这个模型适用于一个将合并到Subversion存储库的人,而另一个人则是纯粹的Git或纯粹的Subversion。通过这种方式,Git用户可以在不合并问题的情况下使用Git。
[Update]
For more details, The reason that why I try to do pure Git at home is that, my company would like to move to Git but manager won't like to make change because developer don't have knowledge with Git on our own repository. So, what I try to do is, I try to make everyone use Pure git while someone can merge back to Subversion during this learning phase. So, in any emergency case, they can still using Subversion.
So, before everyone familar with Git, I cannot transfer repository to use pure Git. So, it will have both update on Subversion and Git. (and Main repository right now is Subversion). So, I try to make the way that Git can working smoothly during I have sync repository by dcommit back to Subversion.
[Question]
I am in the organization which use Subversion as repository, so I dump it as my personal Git (and plan to use replace Subversion with Git in the future)
Now, I have repository that use both Git and Subversion (Main Source). I have a problem to deal with git svn rebase when I have to use both git and subversion.
My Workflow is like below
At Office
- The Repository have Git-svn interface
- I always commit the code to Subversion with git svn dcommit from here.
- I push to my remote git repository at Bitbucket
At Home
- I clone the repository from Bitbucket
- Working with and commit to Bitbucket
Now, Back to OFfice
- git pull
- git svn rebase
- git svn dcommit
- git push
In step 4. I have a problem that I already rebased my branch
Problem now here, when I am back home
When I come back home, I cannot use 'git fetch' because the branch is already rebased. So, I have to remove branch with git branch -D ..... and then git checkout again.
So, I look for the way that we can concurrent use both Git repository and Subversion and do going well with Git after done operation with git svn rebase or git svn dcommit.
Note. I won't prefer to use any git-svn at home. Try to move forward to use only Git.
Found the solution from Version Control with Git book. Page 295.
Instead of use local - master branch, have to checkout remote branch
git checkout remote/master (Detach HEAD)
git merge --no-ff master (merge the local master)
git svn dcommit
git push origin (update to git Repository)
This model is for one person who will merge back to Subversion repository while the other work on pure Git OR pure Subversion. With this way, The Git Users can use Git without Merging problem.
这篇关于当必须使用Git和Subversion时如何处理Git-svn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!