Suppose you have a TFS collection with a Samples
project that contain your Visual Studio solution files.
Now you want to add a f开发者_运维知识库older 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")
精彩评论