简体   繁体   中英

How do I copy the files from one branch to another branch?

I have something like this:

/repo/branch-a/foo/apples
/repo/branch-a/foo/oranges
/repo/branch-a/bar/broccoli
/repo/branch-a/bar/potato
/repo/branch-b/snazz
/repo/branch-b/jazz

now I want to move the snazz folder into a third subfolder of branch-b 'barfoo'

eg, afterwards, it will look like:

/repo/branch-a/foo/apples
/repo/branch-a/foo/oranges
/repo/branch-a/bar/broccoli
/repo/branch-a/bar/potato
/repo/branch-a/barfoo/snazz
/repo/branch-b/barfoo/jazz
/repo/branch-b/snazz
/repo/branch-b/jazz

The way I had initially tried to do this, was check out branch-a, and check out branch -b. Create the barfoo folder in branch-a, and then copy the snazz and jazz folders into barfoo folder.

The problem with this, is that the copy copies all the .svn folders, and so when you try commit, the files in those folders are still pointing back at the branch-b repo.

I could go through and delete all the .svn folders, but if there are a lot of subfolders, then this is quite time consuming, and not a good solution.

If you work with a Windows/Tortoise SVN:

I would checkout the repo, then move snazz and jazz with right mouse button from branch-a to branch-b and select "SVN move versioned items here". This way you will have SVN history preserved.

instead of copying, export them. if you export, its going to copy only the files not the .svn files. tortoisesvn has this option, you can drag and drop with the right click and choose export all.

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