Why does git svn dcommit lose the history of merge commits for local branches?

后端 未结 2 927
忘掉有多难
忘掉有多难 2021-02-02 13:15

I have a local git repository created with git svn clone. I make a local branch, make some changes, switch back to master, git svn rebase and if it\'s

相关标签:
2条回答
  • 2021-02-02 13:31

    Because you're going through svn. You're going to lose a lot of information when you do that (you also lose the author, for example).

    0 讨论(0)
  • 2021-02-02 13:53

    The git-svn man page recommends that you don't use merge. This is one side effect. Since you are rebasing the branch (git svn rebase is a bit like "git pull --rebase") it effectively rewrites history. It may throw away any local commits that are already upstream in subversion, such as the merge, and keep only those commits that really exist in the svn repository. Since a trivial merge commit of a local branch has no equivalent in SVN, you only commit the "real" changes, so these are the only changes seen in your new rebased master branch.

    Ideally your local branch should merge fast-forward only, i.e. no merge commit is generated. If this is not the case, then you should consider rebasing your local branch onto master instead of merging it. That avoids creating a merge commit completely.

    0 讨论(0)
提交回复
热议问题