Question

I set up my TFS Workspace and did TF GET, which downloaded huge quantities of files, exactly as expected.

Then I wanted to trim my local copy down to just the folders I was supposed to work with. So I deleted all the others on my local copy of the workspace (not using TF commands, just Windows and DOS commands)

One of those directories has been added to my list of things to work on.

How do I get that directory back without re-downloading everything?

C:
cd \TFS
TF GET Zebra
(All Files are up to date)

All my non-existant files are apparently up to date with the extant files on the TF server. I am baffled how FileExists is equal to FileNotExists!

After trying about twenty or so variations of this approach, I surrendered.

C:
cd \TFS
TF GET /FORCE

It's downloading a metric ton of stuff. As far as I can tell, it's downloading everything. Funny that the format of the output is different than my original TF GET (but that's really a distraction from the question, which is repeated below).

How do I get TFS to only download the current stuff from the Zebra folder and thus repopulate it so what I have actually matches the server?

And I suppose a side question - If deleting the files without telling TFS about it was the wrong way to clear up the space on my local disk, what should my approach have been?

Sorry if the question is noob-like. But I guess when it comes to TFS I am, in fact, a noob.

Was it helpful?

Solution

Using TFS2010 you will have a server-based workspace, which means the server stores information about your workspace. These information include which files with which version you already downloaded. If you delete them using command line or Windows Explorer, TFS wouldn't recognize your changes. If you then do a "Get Latest" it checks the actual versions of files with the version you should (!) have. So if there is nothing new, TFS will not sent you anything, because it should be already there.

You can use the force option, so you would get the newest files no matter what is already in your workspace (or not)

C:
cd \TFS
TF GET Zebra /FORCE

The problem you face is a result of your workspace mapping, but this depends on how you are working. For example I'm TFS Admin, so I have one workspace for a whole TeamProjectCollection and never did a recursive Get Latest, I only get those files/folders I need. You could do the same with your TeamProject, but then you always need to use VS Source Control Explorer or command line for specific folders, what is not very handy. I would suggest to create a workspace for the branch/folder you are working and cloak the folders you don't need. In this case you can do a GetLastest on your root, but still only get the files you are interested in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top