简体   繁体   中英

Merging Subversion Branches

Just asking a simple question. What is the best way to merge two Subversion branches together?

I wish to merge branch name 3661 into branch name 2011-01-17

3661 has a revision code of 16658

2011-01-17 has a revision code of 16613

This is how I do (I use command line)

(1) Get the revision of 3661 when the branch was created like this

svn log --verbose --stop-on-copy http://url/to/branch/3661

Take the smallest revision from the output. Let's say it's 911

(2) Checkout the latest of branch 2011-01-17 , and run this in the main directory. This will show all the conflicts and updates but won't do anything.

 svn merge --dry-run -r 911:HEAD http://url/to/branch/3661

(3) If you are OK with the changes do a actual merge

 svn merge -r 911:HEAD http://url/to/branch/3661

Nothing is committed on server yet. It's just you local copy is merged. You may want to fix all the conflicted file now.

(4) If you want to persist the merge on server commit the changed files by doing this

 svn commit -m "Merged 3661 changes into 2011-01-17"

Hopefully this helps. You may want to see this chapter of red book http://svnbook.red-bean.com/en/1.0/ch04s04.html

Also, you need command line SVN client. You can download it from Subversion's website

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