简体   繁体   中英

How do I move a folder under a new folder in a TFS Team Project?

Suppose you have a TFS collection with a Samples project that contain your Visual Studio solution files.

Now you want to add a folder called SamplesProductA and move all the files inside it without losing the source control history. How can you do it?

Thanks.

You cannot move the root folder of a team project to anywhere. So if you have files/directories in the root, you need to move the one-by-one to the SamplesProductA folder. You won't lose history with this action.

When you have moved all the files in the SamplesProductA folder, you can (in the future) use that folder to move all the sources to somewhere else. My advise is therefore to always create a subfolder in version control of a team project to be able to move and (even more important) to branch.

Looks like there is a way to do this via command line. Check out this MSDN forum post: http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/b78911f6-a8ce-4fe9-9c31-5c576c8ff9e8/

Here's an excerpt:

You can use 'tf rename' from the command line. Or in PowerShell, it would be something like

> $ws = get-workspace
> $ws.PendRename("foo", "bar\foo")

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