I used to use git to port features between different branches, rebase
, rebase --onto
, cherry-pick
are typical tools I used. But now I have to work with svn. I don't like to use svn's built in merge
command, cause it will combine all the commits into one "merge commit", though with some history traceability after 1.5. Say if I have a range of commits from r100 to r110 in branchA
, now I want to port this feature to branchB
and branchC
by replaying these commits one by one with the same commit comment (resolve any conflicts in between). Is there any automatic tool which can do this for me?
How to transplant patches in svn
496 Views Asked by Terry Shi At
2
There are 2 best solutions below
3

If you can, use git-svn
. The awesome git
history won't be in the central repo, but you'll have a much better time managing the work on your end.
I don't know of any automated tool to do this, but you could implement one along the same lines of
git rebase
. All it does it make a temporary directory and usegit format-patch
to to extract the changes you want to rebase and thengit am
to apply them back to the target root. If you typelocate git-rebase
on your system you can read it -- it's a shell script. It's probably/usr/local/libexec/git-core/git-rebase
.The
svn
equivalent would usesvn diff
andsvn log
to save the original commit information followed bypatch
andsvn commit
.