tfs: how to unlock changes
Asked Answered
N

4

8

I originally edited a file, which did a checkout. I received a new computer, and now I want to edit the file. I don't care about the original edit.

TFS reports that another user has an exclusive lock on the file. It's not actually another user, it's me, but the machine is different, so the workspace is different.

I tried unlocking with the tf commandline using the following command:

tf lock /lock:none /workspace:oldmachinename;domain\me /recursive $/projectname/directory /s:http:tfs:8080/tfs/project

I get no errors, but when I go into Visual studio 2010 (We're using tfs 2010 as well) The files remain locked.

What am I doing wrong?

Nag answered 12/4, 2011 at 17:52 Comment(0)
T
3

Deleting the old workspace is probably what you want to do. You can do this with the tf workspace command, but an easier method is to use the free TFS Sidekicks add-on which gives you a GUI to manage and delete workspaces.

Trouble answered 12/4, 2011 at 22:35 Comment(0)
H
18

Have you tried using TFS powertools?

Once you have that, you can right-click on your folder or file, and choose Find in Source Control -> Status. After you click Find, it should show you all the check-outs, or files that are checked-out

You should then be able to right-click on the checkout and choose "Undo..".

While this is generally issuing the same command line arguments, I've had good luck with it.

Hanser answered 12/4, 2011 at 19:19 Comment(0)
H
3

If you aren't intending to use the old workspace again, it would be a good idea to (carefully) delete the entire workspace. This will clean up everything relating to it, and mean that it no longer "pollutes" listings of your active workspaces, etc.

You can also break the lock on a single file, but you will need to have appropriate permissions to be able to break locks. See here for a specific explanation of how to do it.

Heronry answered 12/4, 2011 at 22:23 Comment(0)
T
3

Deleting the old workspace is probably what you want to do. You can do this with the tf workspace command, but an easier method is to use the free TFS Sidekicks add-on which gives you a GUI to manage and delete workspaces.

Trouble answered 12/4, 2011 at 22:35 Comment(0)
I
0

Try something like this:

The following example unlocks and makes all files in the src/ Team Foundation version control server folder available for check-out and check-in by other users.

c:\projects>tf lock /lock:none src/

More documentation here: http://msdn.microsoft.com/en-us/library/47b0c7w9.aspx

Ihab answered 12/4, 2011 at 17:56 Comment(1)
I get an error stating cannot unlock ... It is not currently locked in your workspace. I've tryed specifying a workspace using /workspace:name;domain\user and still get the errorNag

© 2022 - 2024 — McMap. All rights reserved.