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

前端 未结 5 880
北荒
北荒 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:41

    The Caveats section of the git-svn documentation warns

    For the sake of simplicity and interoperating with a less-capable system (SVN), it is recommended that all git svn users clone, fetch and dcommit directly from the SVN server, and avoid all git clone/pull/merge/push operations between git repositories and branches.

    The author does provide a recommendation:

    The recommended method of exchanging code between git branches and users is git format-patch and git am, or just dcommiting to the SVN repository.

    Adapting to your situation

    git format-patch --stdout c^..i >my.patch
    git reset --hard trunk
    git am 

    where c and i are appropriate identifiers for the commits in your history.

提交回复
热议问题