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?
Asked
Active
Viewed 471 times
2

Terry Shi
- 968
- 1
- 10
- 14
2 Answers
2
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 use git format-patch
to to extract the changes you want to rebase and then git am
to apply them back to the target root. If you type locate 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 use svn diff
and svn log
to save the original commit information followed by patch
and svn commit
.

Ben Jackson
- 90,079
- 9
- 98
- 150
0
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.

Hank Gay
- 70,339
- 36
- 160
- 222
-
The downside to merging in git-svn is that the svn `mergeinfo` does not know about your shenanigans and future merges go poorly (or more poorly -- `svn merge` has done some truly stupid stuff in my experience). – Ben Jackson Feb 01 '11 at 22:12
-
Yeah, I'm actually doing this, but my colleagues won't. I'm trying to find a solution for them :) – Terry Shi Feb 01 '11 at 22:21
-
@Ben My way is never to use svn merge, always track stuff in git. – Terry Shi Feb 01 '11 at 22:21