0

I have an issue using the svn switch command where I have committed to the trunk and then want to switch to a branch and commit that revision to that branch. I'm sure I have done this before, dead easy...just do a svn switch [BRANCHURL] and then svn commit -m 'COMMIT MESSAGE IN HERE'. This does not seem to work.

When I done the switch it showed the changes as "Updated" then when I went to commit there was nothing to commit. Any ideas what i've done wrong?

1 Answer 1

4

So, to clarify, what you've done is

  1. modify a file
  2. commit to trunk
  3. switch to the branch

Note that after 2 you will have a clean copy of the trunk with no uncommitted changes, and so when you switch to the branch it will revert to a clean copy of the branch.

You now need to do

svn merge -c [the commit rev] [TRUNKURL]

to merge the change into your branch working copy so you can commit it there too.

Sign up to request clarification or add additional context in comments.

2 Comments

Am I not able to commit the change to the branch without checking the branch out? My normal procedure is to do a "merge -c" for an individual revision, but I have many branches to work with and i'd prefer not to have to check them out all the time. Is this possible?
Sorry, I'm confused: didn't you say you svn switch ed your trunk checkout into a branch checkout? Yes unfortunatley you will need a checkout of any branch you want to commit into - so you can solve any merge conflicts, run your unit tests, etc. before committing - although you can switch checkouts between branches if you want.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.