12

I should have taken a branch to start with but decided to work on trunk instead, and now I want to create a branch and commit my uncommitted changes to that branch instead of trunk.

Is there an easy way to do that in svn?

1 Answer 1

2

You can use the switch command to switch your working copy the branch and afterwards you can commit the changes you made to the branch. But don't mix changes for trunk/branches. Do the following in your working copy:

svn switch URL/branches/BRANCHNAME

and after changing do the commit.

4
  • Switch was giving some weird errors, but I tried creating a patch and it worked like a charm. Thanks for the direction though.
    – Abidi
    Commented May 22, 2011 at 18:41
  • 1
    Wouldn't switch overwrite or conflict with local changes?
    – Abidi
    Commented May 22, 2011 at 18:43
  • @Abidi: Yes of course if you have uncommitted changes in your working copy.
    – khmarbaise
    Commented May 24, 2011 at 6:39
  • @khmarbaise re: Abidi's comment, isn't switch to a branch WHILE having local changes the exact question that was asked? And your response to Abidi says they will be lost aka overwritten?
    – simpleuser
    Commented Apr 28, 2016 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.