我现在正在使用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 …Run Code Online (Sandbox Code Playgroud) 我正在阅读git-svn的CAVEATS.通过这个SO问题.
我的理解是:
如果您在git repo上镜像svn trunk,branches等,请不要在这些分支上本地合并或重新绑定任何内容.具体master指向了trunk.
我的观点是,这会使git-svn残缺.git有什么意义,如果我不能从master分支然后将更改后的分支合并回主服务器?也许我在警告中遗漏了一些警告,说可以合并某些具有相同父级而没有任何rebase的分支.
任何人都可以向我指出需要避免什么以及允许什么.我想要本地分支,如果需要,那些需要被镜像和合并,最重要的是git应该进行合并而不是svn.
如果我使用git branches来镜像svn分支而且我不能合并git分支,那么git-svn究竟是什么意思呢?