Using git-svn to merge a svn branch back into trunk and trunk back into the branch

前端 未结 5 876
北荒
北荒 2021-02-05 19:39

So I\'m using git and interacting with an svn repo.

I have a svn TRUNK that looks like this:

A-B-C-D

And a svn bug_fixes branch that br

5条回答
  •  走了就别回头了
    2021-02-05 20:28

    Ok, so a few approaches that I found:

    git checkout your_branch
    git rebase master
    git checkout master
    git merge your_branch
    

    or

    git checkout your_branch
    git rebase master
    git checkout master
    git merge --squash your_branch
    

    or

    git checkout your_branch
    git rebase master
    git checkout master
    git rebase -i your_branch
    

    And then after all that.

    git svn dcommit (to commit to master)
    git branch -D your_branch
    

    Then (from svn because git-svn doesn't support deletion) delete the branch, and recreate it from trunk and start the cycle all over again.

提交回复
热议问题