Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS: Check out an item without getting latest version, or resolve conflict by using local file

Using VS 2010 & TFS 2010:

I have a TFS team project that was migrated from Visual SourceSafe.

While the migration was carried out on the server, I made changes to my local working copies of the files. Now I want to check in those changes.

  • I have mapped the team project to a local folder. When I did a Get Latest, all files that weren't writable on disk were added to the workspace.

  • For the files that changed, and were writable, I get conflicts. In the "Pending Changes - Conflicts" pane, the only options for each conflict are to 1) "Overwrite Local File or Folder", or 2) AutoResolve the conflict using AutoMerge to merge "Conflicts with any content changes".

    • Option 1 is the opposite of what I want. I want to check out the file and use my local copy, not the server copy, in the workspace.

    • Option 2 doesn't do anything when I try it.

  • If I try to check out one of the changed files, I get the error: "The item [item] could not be found in your workspace, or you do not have permission to access it".

How do I check out, then check in, local changes without first getting a copy of each file from the server?

like image 320
nekno Avatar asked May 24 '11 23:05

nekno


2 Answers

Normally you would have a third option to "Keep the local version". I guess you don't have it because the local files are just exact local copies of the server files. They are not part of the workspace, and that's why ou get the error when trying to check them out.

One quick solution is to move the local copies out of the workspace, do a get latest so their server copies get downloaded to your workspace, then check these downloaded files out and replace them with your correct local copies.

Alternatively, you can try do an Add (tf add - if you use the command-line tool) instead of an Edit on the local copies, then do a Get Latest again. With the files being added to your TFS server, you'll probably get the third option to "Keep the local version".

Hope this helps.

like image 185
Duat Le Avatar answered Sep 24 '22 07:09

Duat Le


I had the same problem using Visual Studio 2010 but I was able to choose another option "Keep Local Version" using Visual Studio 2012 RC.

I have both Visual Studio 2010 and Visual Studio 2012 RC installed on my machine, Visual Studio 2010 only have one option "Overwrite Local File or Folder" but Visual Studio 2012 RC has two options "Overwrite Local File or Folder" and "Keep Local Version"

like image 36
StarCub Avatar answered Sep 22 '22 07:09

StarCub