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

后端 未结 12 874
臣服心动
臣服心动 2020-12-01 01:01

We have a project that is stored within our TFS server and some files were Checked-Out by me from another computer and another user (both of which are not used anymore). Is

相关标签:
12条回答
  • 2020-12-01 01:43

    You need to be project admin or to have tfs account (user name/password) of the user who had locked the file.

    in Visual Studio 2019:

    • Menu > View > Terminal (ctrl+`)
    • Wait until developer powershell or command prompt loads to the cursor like this:
      Drive:\your solution path>
    • you must undo changes to unlock the file:
      tf vc undo /workspace:"workspacename;worksapceowner" "$/path/[file.extension][*]" [/recursive] [/login:"user name,password"]
      example:-
      tf vc undo /workspace:"DESKTOP-F6BN2GHTKQ8;Johne123" "$/mywebsite/mywebsite/appsettings.json"
    0 讨论(0)
  • 2020-12-01 01:46

    If you login into the source control with the admin account, you will be able to force undo checkout, or check in with any file you provide.

    0 讨论(0)
  • 2020-12-01 01:51

    I solved this with the 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 files checked out to a specific person

    right click and UNDO... can remove each checkout.

    0 讨论(0)
  • 2020-12-01 01:51

    In my case, I tried unlocking the file with tf lock but was told I couldn't because the stale workspace on an old computer that no longer existed was a local workspace. I then tried deleting the workspace with tf workspace /delete, but deleting the workspace did not remove the lock (and then I couldn't try to unlock it again because I just got an error saying the workspace no longer existed).

    I ended up tf destroying the file and checking it in again, which was pretty silly and had the undesirable effect of removing\ it from previous changesets, but at least got us working again. It wasn't that big a deal in this case since the file had never been changed since being checked in.

    0 讨论(0)
  • 2020-12-01 01:54

    2019 answer, as most of the above is depracated.

    tf undo /workspace:"hostname;username" "$/path/*" /s:https://yourhostname/tfs in an elevated command prompt, from a path such as C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>

    0 讨论(0)
  • 2020-12-01 01:59

    You can use the Status Sidekick of TFS Sidekicks tool and unlock the files which are checked out by other users. To do this you should be a part of Administrator group of that particular Team Project (or) your group should have the permissions to undo and unlock the other user changes which by default Administrator group has.

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

    0 讨论(0)
提交回复
热议问题