TFS get command erroneously returns “All files are

2019-02-11 14:15发布

We are just in the process of migrating our TFS repo to Mercurial as we've had enough of TFS. Unfortunately TFS has thrown us one last curve ball before it lets us go. We've wrote a script that we intend to have "get" each changeset (including timestamp, check-in comment etc) and then add them to the Mercurial repo and check it in.

Unfortunately TFS is acting very strange when we execute the tf get * /version:C111 /overwrite command. It immediately returns "All files are up to date." But this is impossible. The workspace folder is empty! And viewing the details for the 111 changeset quite clearly shows that the changeset contains "stuff" i.e. the repo is certainly not empty.

What could be causing this?

标签: tfs
12条回答
一纸荒年 Trace。
2楼-- · 2019-02-11 14:43

My problem was that I was running VS developer command prompt from VS 2012 studio but my workspace mapping is inside vs 2013.

Make sure you run tf.exe from inside of visual studio directory which has workspace mapping, than simple tf.exe get "path" /all /recursive works just fine

查看更多
虎瘦雄心在
3楼-- · 2019-02-11 14:44

I just had to fix this problem:

  1. Get Tfs power tools. You can also get it from tools > Add-in manager inside visual studio.

  2. It will require you to close visual studio to complete installation.

  3. Once complete, open a command prompt in admin mode.

  4. cd to your branch/solution directory.

  5. run tfpt scorch (tfpt.exe comes with the power tools, if you don't see it, reinstall)

  6. If it finds stuff missing, it will open up a dialog. Just hit next or ok and it will overwrite anything that does not match the server.

查看更多
太酷不给撩
4楼-- · 2019-02-11 14:48

TF will return "All files are up to date" if the itemspec you pass in is not found. If you don't include an absolute path, a relative path is assumed.

For example if you send

tf get myFile.cs /version:1009 /force

it looks in the current directory for myFile.cs, which doesn't exist, so it returns "All files are up to date." What we really want is

tf get C:\myproject\myFile.cs /version:1009 /force

Same thing with wildcards, eg

tf get D:\project\* /version:C111 /overwrite

Check out the itemspec link for more info.

查看更多
走好不送
5楼-- · 2019-02-11 14:53

You should try /all instead of /overwrite, this will force it to get all files, not just the ones it remembers getting to this workspace on the previous get.

MSDN Reference for Get

查看更多
够拽才男人
6楼-- · 2019-02-11 15:00

This can happen if you do not have adequate permissions to the source. I was able to see the entire source tree, all files, but I could not get the most recent version. I guess this is permission flexibility taken to the extreme (absurd?). To verify the issue was not workstation or mapping related, I tried looking at a code file on the team pages and received:

Image demonstrating lack of access to source file

查看更多
Luminary・发光体
7楼-- · 2019-02-11 15:00

Check your workspace. I went to delete it as above (which probably would have fixed it as well) but I noticed that someone a project within my project got it's own workspace assigned in addition to the overall workspace. I removed that project from the workspace and it downloaded all my files when I clicked ok to exit the workspace menu.

查看更多
登录 后发表回答