简体   繁体   中英

Merging trunk with branch using subversion and intellij

I made a whole bunch of changes to one of the branches. Now I am trying to merge these changes with the trunk. In order to do that I created two working folders on my machine called BRANCH and TRUNK. I did an svn co of branch in the BRANCH directory and an svn co of trunk in the TRUNK folder. Once the check out was complete, I went ahead and opened up the subversion history of all the checkins I did on the branch. Once I got the version numbers for all my check-ins, I went within my TRUNK folder and issued the following command:

 svn merge --dry-run -r1xx0:1xx1 svn+ssh://pathtomybranch/

The funny thing is that the above command executes without any output, which essentially indicates my branch and my version do not have any differences. Which is not possible since the content of the files for the version I am trying to merge are different.

Does somebody have some ideas on what might be going wrong here?

Thanks

You first have to update the branch with all the changes that were made to trunk since you've created the branch (you can skip this step if no changes have been made to the trunk since the branch was created):

cd branch
svn merge url://of/trunk

Then you can choose between two identical(?) methods:

1) use reintegrate branch:

cd trunk
svn merge --reintegrate url://of/branch

or 2) use merge between two trees:

cd trunk
svn merge url://of/trunk url://of/branch

Method 2) calculates the differences between the two trees "trunk" and "branch" and merges them back to the current directory (which is trunk).

Method 1) is just syntactic suggar for method 2).

Note that for neither of the two methods you have to specify revision numbers. All recent versions of SVN handle that automatically for you.

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