开发者

Retaining topic branch commits with git-svn dcommit

I started using git-svn recently. My git work flow is like this.

git checkout master

git svn rebase

git checkout -b topicbranch

..changes

git commit

git checkout master

git merge topicbranch

git svn rebase

git dcommit

Problem is that, whenever I do dcommit the only final merge commit of topic branch is seen in svn repository. I want to see the svn commits corresponds to individual git commits made in topic branch.

Is their any way to do it. Or this is the recommended defa开发者_JAVA技巧ult behavior.


(git rebase with no additional arguments is an error, so I suspect you're not accurately describing what you're doing. Also, you've missed out the svn in git svn dcommit.)

However, it looks to me as if the problem is that you're merging topicbranch into master without rebasing it first. That means that if this doesn't turn out to be a fast-forward merge, there'll be a merge commit added in the git history, and that can only be represented by a single commit in Subversion. After you've worked on your topic branch, try the following instead:

# make sure you're on the right branch first:
git checkout topicbranch 
git rebase master
git checkout master
git merge topicbranch
git svn rebase
git svn dcommit
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜