开发者

dcommit to SVN in 1 commit after cherry-picking in git

I would like to know if there is a clean way to do git-svn dcommit of multiple local commits as 1 commit into subversion.

The situation that I have is I am cherry picking some bug fixes changes from our trunk into the maintenance branch. The project pre开发者_StackOverflow中文版ference is to have the bug fixes to be committed as 1 commit in subversion, but I would like to keep the history of changes that I had cherry-picked on my local git for references.

Currently what I do is to do all cherry-picking on branch X and then do a squash merge into new branch Y. The dcommit will then be done from branch Y.

Is there a better way to do it without using an intermediary branch?


You can't do that without using extra branches. The branch you dcommit from will reflect the SVN view of history after you dcommit. If you would like to preserve the original unsquashed git view with multiple commits, you will need to use an extra branch.

(And yes, I wish this wasn't true too)


You can squash things together with git reset --soft or git rebase -i (if it is not top commits).

Example: git reset --soft HEAD~4 && git commit -m 'Bug fixes' will sqush 4 last commits into one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜