简体   繁体   中英

“Merge” new file in trunk into a branch

This should be trivial and obvious but I can't find any examples of this. (I'm certain that's because I'm just searching for the wrong words.)

I need to merge a file from the trunk of my repository down into a branch. The file is new in the trunk, and not yet in the branch; therefore, the normal way that I know to do a merge just doesn't work. Thus, I need to get that new file into the branch somehow.

I need to do this selectively with particular files; in other words I don't want to merge down the whole trunk, and I can't even merge a whole changelist.

Thanks for any suggestions.

edit — I realize I can just copy the file from my trunk workspace and svn add it to the branch, but I don't think that's the "right" way to do this.

您可以执行类似svn cp ^/trunk/file1 ^/branches/mybranch/file1 ,将单个文件从主干复制到分支。

Find the parent directory that already exists in the target branch. Use --depth to recursively merge directories and files.

For example:

svn merge -c 1234 --depth infinity ^/RING/trunk/exec/parent parent

Where 1234 is the revision number to be merged.

New files could exist in ^/RING/trunk/exec/parent , but are not yet created in the parent directory of the target branch. The above merge command would add the new files in the target branch parent directory.

The following command, ignores any conflicts, overwrites old files and adds new files: Go to TRUNK directory and merge from BRANCH:

svn merge --accept theirs-full

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