git svn workflow - feature branches and merge

后端 未结 4 1963
北海茫月
北海茫月 2020-12-02 08:33

I am using git-svn with the following workflow now

git clone  #done once

subsequently when I work on a feature

4条回答
  •  佛祖请我去吃肉
    2020-12-02 08:59

    SVN cannot handle non-linear history (it simply has no notation of it). So what you want to do is a rebase instead of a merge as it preserves linear history with SVN (this is indicated in on the git-svn man page here.

    To elaborate, linear histories are trivial. They go in a straight line (A to B to C to D). Whereas non-linear histories can go from (A to B to C, B to D then C + D to E--in other words, they off sprout into branches).

    Rebasing will give you a linear history. Remember that rebases should be done from your private local-only branches. For instances, if you have 2 branches: master and experimental. You would checkout experimental and do 'git rebase master' preferably with the -i flag. Doing it the other way around may result in undesirable side effects.

    It is then you checkout master and merge in the changes from the experimental branch. Your history should remain linear.

提交回复
热议问题