开发者

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 rev开发者_运维知识库ision 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜