Git -svn: How do I avoid <branchname> branch merge messages?
This is my current git-svn workflow:
git checkout -b feature master # hack commit hack commit git checkout master git svn rebase git merge feature git svn dcommit Usually this works fine, git repeats all the commits from the local branch in the trunk, and the only lost data is the original commit timestamps, without a lot of cost.
But it looks like there was something different today with regard to merging and dcommit, which caused the commit message in the SVN repository to be just like the Merge Branch function, perhaps because the function was โsmallerโ, with only 2 or 3 commits.
How can I avoid this and make sure that all transactions and commit messages from git are reproduced in the SVN repository?
This comment should be the result of a dcommit git merge, as shown in Is git-svn dcommit after a merge in git is dangerous? "
(master)$> git log --graph --oneline --decorate * 56a779b (work, master) Merge branch 'work' |\ | * af6f7ae msg 3 | * 8750643 msg 2 | * 08464ae msg 1 |/ * 21e20fa (git-svn) last svn commit In other words, if these three " msgx " msgx were done directly on the host, they would be played back (with their original comments) on the svn side.
But here only the resulting merge merge is replayed with the โgeneralโ comment.
First you need to reinstall the functions from the branch:
git checkout feature git rebase master This ensures that when merging with your master, you will get fast forward rather than the actual merger.
My thread is usually more like this:
git checkout master git svn rebase git checkout feature <hack...hack...hack> git commit git rebase master git checkout master git merge feature Iโll just be sure to reboot svn and then reinstall all my function branches so that everything is fine and linear, as SVN likes it.
In addition, if you are not aware of this, there is a git svn dcommit --dry-run option. I always use --dry-run and count the number of commits to make sure git -svn is about to accomplish what I expect.