How to unlock a file from someone else in Team Foundation Server

We have a project that is stored on our TFS server, and some files were checked by me from another computer and another user (both of which are no longer used). Is there a way to force the file to be unlocked (there were no changes in it, so I can do this if I can).

+71
tfs filelock
Aug 10 '10 at 17:21
source share
9 answers

If you log in to the original control with an administrator account, you can forcibly cancel the check or register with any file that you provide.

+14
Aug 10 '10 at 17:34
source share

Here is what I do in Visual Studio 2012

(Note: I have TFS power tools installed, so if you don’t see the parameters described, you may need to install them. Http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f )

If you access the version control explorer as a project administrator (or at least someone with the β€œCancel other users” access rights), you can do the following in Visual Studio 2012 to remove the lock and validation.

  • In the source code explorer, locate the folder containing the locked file (s).
  • Right-click and select Find , then Find by Status ...
  • The "Search Source" window will appear.
  • Click Find
  • The "Find in source control" tab appears, in which the files (s) that are marked are displayed
  • Right-click on the file you want to unlock.
  • Select Cancel ... from the context menu
  • A confirmation dialog box appears. Click Yes .
  • The file should disappear from the "Search Source" window.

The file is now unlocked.

+119
Jul 25 '13 at 23:12
source share

You can use the Sidekick tool for TFS Sidekicks and unlock files that are checked by other users. To do this, you must be part of the Administrator group of this particular team project (or), your group must have permissions to undo and unblock other user changes that the Administrator group has by default.

You can get the tool here: http://www.attrice.info/cm/tfs/

+43
Aug 11 '10 at 7:20
source share

I was able to cancel another user check with the following command:

tf undo {file path} /workspace:{workspace};{username} 

You will need to put this semicolon in double quotes if you use a command from PowerShell. We are launching TFS 2010 (and VS 2010).

Disclaimer: I got this from the FCI-H blog at http://fci-h.blogspot.com/2011/01/how-to-force-undo-checkout-tfs.html

+34
Nov 04 2018-11-11T00:
source share

Team Foundation Sidekicks has a Status link that allows you to request verified work items. After selecting a work item, click the "Cancel Lock" button on the toolbar.

Rights

Keep in mind that you will need the appropriate rights. The permissions are called Undo Changes by Other Users and Undo Changes by Other Users. These permissions can be viewed:

  • Right-click the project, folder or file in the source explorer
  • Select Properties
  • Select the Security tab
  • Select the appropriate user or group in the "Users and Groups" section at the top
  • View the "Permissions for [user / group]:" section below

Screenshot of unlocking a file using Team Foundation Sidekicks

Disclaimer : This answer is an edited Brett Roger answer to a similar question .

+20
Jan 28 '13 at 15:20
source share

I solved this with TFS powertools (dec 2011 - for VS 2010 TFS 2010)

http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f

Find in source control | Status ... allows you to find all the files written out to a particular person.

right-click and UNDO ... can delete each statement.

+14
Sep 16 '13 at 14:00
source share

Based on stackptr answer I created a batch file UnlockOther.bat

 @rem from https://stackoverflow.com/questions/3451637/how-to-unlock-a-file-from-someone-else-in-team-foundation-server @rem tf undo {file path} /workspace:{workspace};{username call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 @echo on tf undo $/MyTfsProject/path/fileName.ext /workspace:CollegeMachine;CollegueName /login:MyLogin @pause 
+6
Feb 23 2018-12-12T00:
source share

Team Foundation Sidekicks did a great job with me.

The file did not unlock, so I discarded the pending changes, after which I was able to delete the file.

+4
Feb 07 '13 at 17:39
source share

Use the unlock command that comes with TFS

  • Click Start, select All Programs, Microsoft Visual Studio 2008, Visual Studio Tools, and Visual Studio Command Prompt.
  • Enter the following command and replace the arguments with the appropriate parameter information for your needs: tf lock / lock: none $ / MyTeamProject / web.config

tf lock itemspec / lock: (none | checkout | checkin) [/ workspace: workspacename] [/ recursive] [/ login: username, [password]] [/ collection: TeamProjectCollectionUrl]

From MSDN

+1
Aug 30 '16 at 21:11
source share



All Articles