Reputation:
I'm a bit lost with Subversion (1.5+) here:
I modified the trunk in my local working copy, added new files and directories, etc., but eventually I decided that it would be better to work on a separate branch, so I created one from the base revision of my trunk.
That was the easy part. But what's the best way to move my locally modified files, including added files and directories, to the branch now?
I already tried to switch the trunk like so:
project/trunk $ svn switch svn+ssh://[email protected]/project/branches/mybranch
This worked for some files but then gave me an error message like that when it occurred an added directory:
svn: URL 'svn+ssh://[email protected]/svn/project/branches/mybranch/component/impl/src/main/java/com/xxx/yyy/addeddirectory' doesn't match existing URL 'svn+ssh://[email protected]/project/branches/mybranch/addeddirectory' in 'component/impl/src/main/java/com/xxx/yyy/addeddirectory'
Thanks for any pointers!
Upvotes: 1
Views: 2726
Reputation: 63652
If you haven't committed changes then you could create a patch file from your local copy of files:
svn diff > patch.txt
and then apply that to a new branch
patch -p0 -i patch.txt
More of an explanation here:
http://ariejan.net/2007/07/03/how-to-create-and-apply-a-patch-with-subversion/
If you're using Windows you can do this with TortoiseSVN also...
Upvotes: 5