Question

Can I take multiple revisions in Subversion and combine them into one?

I'd like to be able to take a few commits that include some interim blind alleys that I no longer care about and produce a single revision. For no reason other than to tidy up the svn history of a bug fix a litle bit.

Was it helpful?

Solution

You can do this using svnadmin dump, then manually editing the dump file, and svnadmin load it again, but it’s not recommended to do this because it’s error-prone and somewhat defeats the purpose of version control.

Don’t do it.

OTHER TIPS

No

If you could do this you could change the history of your subversion server. How can you trust your code if you can modify old revisions?

Really I mean, you shouldn't want to do this. If you have old commits that you don't like, even if you could 'delete' them, you shouldn't want to. They are part of this history of the HEAD. Only the tip needs to be great. You'll make many more mistakes in this code... just fix them and move on.

No. You cannot.

You can edit the commit notes if you install a pre-revprop hook on your repository, that's as close as you will be able to get.

It is not something standard or desirable in version control systems. You could of course, with a huge amount of work, proceed to incremental checkouts, copy the file to another new local database with commits where you want to have them (and even like that, moves or deletes would be hard to manage).

What you can easily do is drop files and paths from a repository with a svnadmin dump coupled with a svndumpfilter. That could help you get rid of files that have no place in a repository, which is an easy mistake (deleting them with SVN still leaves them in the repository, which sometimes leads to huge ones). To use with caution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top