Take the 2-minute tour ×

Is there any way to merge two users' history into one user in SVN?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

You can change the author of a revision with this command:

svn propset --revprop -r <revision number> svn:author <username>

You will just have to extract which revisions were made by one author in order to rename them.

The hook script of your repository have to allow author renaming though (namely pre-revprop-change).

share|improve this answer
this sounds like the best approach, there are so many revisions but I guess I can just write a simple loop and change all of them. –  dr. evil Oct 22 '09 at 20:23
+1 Now why didn't I think of that? If he wants to modify in-place, this'll be simplest. If he's merging more than one repository, and merging users is just one aspect of it, then svndumptool will be a huge help. –  retracile Oct 22 '09 at 20:25
add comment

Try using svnadmin to dump the repository to a text file, use some text tool to replace the one author for the other. Then use svnadmin to load the file into a new repository.

share|improve this answer
I used this same trick when we moved to a new repo so I didn't show up in "blame" as the modifier for everything. –  Matt Davis Oct 22 '09 at 19:52
add comment

You'll need to dump the svn repository to a dump file, modify it, then load it to create a new repository. The tool to use for the modification would most likely be svndumptool; IIRC, you should be able to use the 'transform-revprop' functionality to change author names.

Now, the subversion dumpfile may look like a text file, but it isn't quite. It has length specifiers embedded in it and such-like, so you can modify it by hand to some extent, but you have to be very careful about it.

Disclaimer: I have contributed to svndumptool in the past

On the other hand, RedGlyph's approach may be simpler.

share|improve this answer
add comment

Your Answer


