MrWayne
MrWayne

Reputation: 151

Subversion 1.8 Merge branch partially

I'm working with a codebase as a single developer, where I decided to develop some features in a testing branch of my SVN repository, which I manage using TortoiseSVN. Meanwhile, I applied some changes to the trunk.

Now the work in the feature branch is done, and I have committed them. Now the feature branch contains some changes I want to merge back into the trunk, and some that I don't want to merge (e.g. modifications that only applied in the work I had done in the branch, which affected files which were not changed in the trunk after the branch creation). Meanwhile I commited some bugfixes to the trunk.

Now if I do a merge operation of the branch into the trunk, all files that were changed in the feature branch, but not in the trunk will be overwritten with the files from the feature branch. How can this be avoided, i.e. how can I select, which files are to be merged from the branch into the trunk?

I also tried first merging the trunk back into the feature branch, but the problem remains: If files in the trunk were not changed, which were changed in the feature branch, those from the feature branch will be used when merging back into the trunk.

Upvotes: 0

Views: 106

Answers (1)

Ben
Ben

Reputation: 8905

If you are willing to take the time to go through and pick each change you don't want to merge before the merge, isn't it exactly the same effort to go through and revert each change you don't want after the merge?

Merge only affects a working copy, so nothing is "final" until you commit.

Just do the merge as normal, and use the "Revert" command on any file you didn't want to modify.

Upvotes: 1

Related Questions