Hello,
Am trying to merge (from a branch) a file in a directory that does not yet exist on trunk. Here is the example:
Trunk (from which we branch)
/
/root1.txt
/foo/foo1.txt
Branch (after 2 checkins)
/
/root1.txt
/foo/foo1.txt
/bar/bar1.txt
/bar/bar2.txt
First checkin:
A /bar
A /bar/bar1.txt
Second checkin:
A /bar/bar2.txt
Assuming the trunk hasn't changed, is it possible to get only /bar/bar2.txt into the trunk? Here are the solutions I have tried already:
svn merge -rX:X+1 /path/to/branch/bar . --> nothing gets merged here
svn merge -rX+1:X+2 /path/to/branch/bar . --> pulls bar2.txt into the trunk but not within bar directory
svn merge -rX:X+1 /path/to/branch . --> pulls both directory and bar1.txt into trunk
svn copy /path/to/branch/bar . --> recursively copies directory bar into trunk
mkdir /path/to/trunk/bar
svn add bar
svn merge -rX+1:X+2 /path/to/branch/bar bar/
The final solution here kind of works. It allows me to only pull in bar2.txt into the trunk and continue but when I try to reintegrate my branch back into trunk later, you then get tree conflicts on the directory (directory gets added in both places -> 'local add, incoming add upon merge').
I understand that if my team would do finer grain check ins - i.e. add the directory in a single commit and the files in another - then I could merge as I am trying to above. Is that the only solution?
- It seems like SVN allows you to merge individual files from a branch into the trunk so is it possible with individual dirctories (non-recursively)?
- In the partial solution I found above, can I mark the directory in the branch as merged to the trunk independently of the other files that were checked in at the same time so that I don't get the tree conflict?
Thanks!