Is git-svn dcommit after merging in git dangerous?

后端 未结 6 984
孤独总比滥情好
孤独总比滥情好 2020-11-28 00:26

My motivation for trying out git-svn is the effortless merging and branching. Then I noticed that man git-svn(1) says:

Running git-merge or git-pull

6条回答
  •  一向
    一向 (楼主)
    2020-11-28 00:32

    A safe way to merge svn branches in git is to use git merge --squash. This will create a single commit and stop for you to add a message.

    Let's say you have a topic svn branch, called svn-branch.

    git svn fetch
    git checkout remotes/trunk -b big-merge
    git merge --squash svn-branch
    

    at this point you have all the changes from the svn-branch squashed into one commit waiting in the index

    git commit
    

提交回复
热议问题