Commit changes to a different branch than the currently checked out branch with subversion

Paul Alexander picture Paul Alexander · May 6, 2010 · Viewed 55.4k times · Source

I've been working on code checked out from the development line and discovered that the changes made might be breaking changes and need to be moved to an experimental branch before committing to the main dev tree. However, I don't have the experimental branch checked out and I don't want to lose the changes that have already been made.

Is there a way to commit the changes in the working folder to a different branch than originally checked out?

Answer

ryanprayogo picture ryanprayogo · May 6, 2010

You should create a branch from a known sourceURL (this would be your 'development line' you mentioned in the question) first:

svn copy sourceURL branchURL

Then, switch to that branch:

svn switch branchURL

And commit your changes:

svn commit