Pra*_*eep 26 git version-control git-svn
我现在正在使用git-svn以下工作流程
git clone <SVN TRUNK URL> #done once
Run Code Online (Sandbox Code Playgroud)
随后当我处理一个功能时
git branch featureZ
git checkout featureZ
#make edits for featureZ
git commit
git checkout master
git svn rebase # fetch changes from server
git checkout featureZ #go back to branch
#git merge master
git rebase master #get the changes from SVN->master onto the branch now. Optional if I want the branch to be current. (EDITED: Got from the answer given below)
#make edits for featureZ
git commit #featureZ completed
git checkout master
git merge featureZ #getting featureZ onto master. Prepare to send to SVN
git svn dcommit #push featureZ back to SVN
Run Code Online (Sandbox Code Playgroud)
现在我将git合并到master上时会有一些注意事项,featureZ分支中的所有单独提交都会合并为一个对我来说很好的.
提交消息被替换为"与featureZ合并".这可以通过merge fmt msg修复.
现在我的问题是这个工作流程有什么问题可以解决或需要处理.我在git-svn手册中读到了在使用git svn时不应该进行合并.我在工作流程中所做的是他们所指的是什么?如果是这样会引起什么样的问题?有一件事是我不想做与SVN主线混淆的事情.
Fak*_*hid 26
SVN无法处理非线性历史(它根本就没有它的符号).所以,你想要做什么是底垫,而不是合并,因为它保持了与SVN线性的历史(这表明在混帐svn的手册页这里.
详细说来,线性历史是微不足道的.它们沿直线(A到B到C到D).虽然非线性历史可以从(A到B到C,B到D再到C + D到E - 换句话说,它们会发芽成分支).
重新定位将为您提供线性历史记录.请记住,rebase应该从您的私人本地分支机构完成.例如,如果您有2个分支:主分支和实验分支.你会结账实验并最好用-i标志做'git rebase master'.反过来做可能会导致不良副作用.
然后你结账大师并合并来自实验分支的变化.你的历史应该保持线性.
| 归档时间: |
|
| 查看次数: |
10213 次 |
| 最近记录: |