简体   繁体   中英

How to merge working copy into Base revision in subversion

EDIT my issue had nothing to do with SVN itself (see my answer below)

I'm using Tortoise SVN. I have a file that several developers are working on, including me.

I updated before I started working on the file, but another developer made changes to the file and committed. I updated my local (which, if I understand right, makes my local Working Base copy of the file match the Head revision in the repo). When I do a diff, TortoiseMerge shows me the changes made by the other developer in the Working Base copy, and my changes in the Working Copy.

What I want to do is have my changes and the other dev's changes merged. I understand that if we edited the same line I may get a conflict and am happy to merge manually at that point. But I would like to be able to have svn do the automatic merging of both sets of changes without either set getting clobbered.

Last time this happened I just committed, expecting it to merge on the way in, but my changes clobbered the other dev's. Suggestions? Settings? Lack of understanding svn on my part (entirely possible)?

如果你们两个都使用同一个分支,则可以合并其他开发人员的更改(例如修订版99)

svn merge -r 98:99 dir/filename

Subversion doesn't merge when you commit. It merges when you update.

If the other developer has made changes to the same file as you have, when you'll try to commit, Subversion will refuse and tell you to update first. You will then update, and subversion will try to merge the other dev's changes into your working copy. If there is a conflict, it will tell you. Else, your working copy will simply contain both sets of changes. You will then commit the file, and both sets of changes will thus be stored in the repo.

Sorry for the bogus question.

I figured out what it was. I'm using Eclipse and I must have saved over the top instead of refreshing from disk before committing. So my local working copy was being updated correctly, I was just clobbering it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM