Caleb Brinkman
Caleb Brinkman

Reputation: 2529

Update SVN branched working copy from trunk

I have a branch from trunk that is currently out of date. My working copy commits to and updates from this branch. What is the simplest way to bring either my branch or my working copy up to date with trunk?

I tried merging from trunk into the branch, and got a permission error (I think because I don't have the permissions necessary to commit modify trunk directly) using this command:

svn merge [url_to_trunk] [url_to_branch]

To circumvent this I have been deleting the contents of my branch and copying trunk over again; this is obviously somewhat inconvenient, so I'd like to know if there's a way to update my working copy to the trunk url, then commit to the branch.

Upvotes: 1

Views: 1841

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97270

  1. You must read the SVN Book about Basic Merging or, at least, svn help merge
  2. You do not use merge blindly, without understanding the process
  3. You do not use 2-URL merge unless it is really needed

You'd use the 1st form of a merge, a "complete" merge after all:

merge SOURCE[@REV] [TARGET_WCPATH]

where

  • SOURCE is the URL of your trunk
  • TARGET_WCPATH is the local path to the Working Copy of your branch (clean WC without local modifications, mixed revisions etc.). This may be omitted if the current directory is the root of WC

After the merge (and after resolving all possible conflicts in this "Big Bang Merge") your Working Copy will be changed and will contain all changes from trunk, added after divergence of history into branch and trunk. In order to have this state saved, you must commit this mergeset into your branch.

Upvotes: 3

Related Questions