ChatGPT解决这个技术问题 Extra ChatGPT

How to undo another user's checkout in TFS via the GUI?

tfs

As the resident TFS admin, on occasion I am asked to undo a checkout (usually a lock) that a user has on a certain file. This can be done via the command line using the TF.exe utility's Undo command (see http://msdn.microsoft.com/en-us/library/c72skhw4.aspx), but that's kind of a pain.

Is there a way to undo another user's checkout via the GUI?


A
Alex

Out of the box, no, but there are at least a couple of options via add-ons.

TFS Power Tools

TFS Power Tools (Visual Studio 2010)

TFS Power Tools (Visual Studio 2012)

TFS Power Tools (Visual Studio 2013)

TFS Power Tools (Visual Studio 2015)

Once installed:

Open Source Control Explorer Right-click the item on which checkout is to be undone (or a parent folder of multiple files to be undone) Select Find in Source Control and then Status In the Find in Source Control dialog, leave the Status checkbox marked Optionally, enter a value for the Wildcard textbox Optionally, enter a username in the "Display files checked out to:" textbox and select that radio button Click Find This will result in a list of files Select the items to undo Right-click and select Undo Click Yes when prompted with "Undo all selected changes?"

Team Foundation Sidekicks

Another option is to use the Team Foundation Sidekicks application, which can be obtained here: http://www.attrice.info/cm/tfs/

It has a Status sidekick that allows you to query for checked out work items. Once a work item is selected, there are "Undo pending change" and "Undo lock" buttons that can be used.

Rights

Keep in mind that you will need the appropriate rights. The permissions are called "Undo other users' changes" and "Unlock other users' changes". These permissions can be viewed by:

Right-clicking the desired project, folder, or file in Source Control 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 at the bottom


standalone app instructions: Status tool \ select user that has file locked/checked out \ search \ select file \ select unlock button \ select undo button
I have been using Sidekicks, for whatever reason it is no longer working? Have not changed TFS, still on TFS2013. Anyway, TFS Powertools for VS2015 works great!
This is great! VS2015 + TFS Powertools for VS2015, I now can finally clean out the pending changes from a developer who's been gone for years. They've been bugging me since I started where I'm at, now it's all clean! Thank you Brett!!! :)
It doesn't seem to work with local workspaces. -- Also, I'm a project admin in TFS, but there is no "Security" tab in the properties dialog for the project. Just "General", "Status", and "Branches".
It's too bad they didn't include this for VS 2017.
s
saeid mohammad hashem

I just had this problem myself and found an easier way to clean up old workspaces.

1) In visual studio, open source control explorer.

2) From the 'Workspace' dropdown select 'Workspaces...'

3) A dialog will appear showing the workspaces on your current PC. Select 'Show remote workspaces'

4) You will now also see workspaces from your previous PC (as long as they are from the same user account). Select the old workspace(s) and click 'Remove'. This should delete the old workspace from from TFS along with any persisting checkouts.

I'm sure Arne has found a solution but I hope this helps others who google the issue.


Actually it's not an answer to this question, and your situation is a special case, however it's helpful so +1.
e
erickalves05

Command line

tf undo /workspace: OtherUserWorkspace;OtherUser $/TeamProject/MyFile.cs /s:http://YourTFSServer:8080

https://msdn.microsoft.com/en-us/library/cc470668.aspx


E
Eddie Lay

if you use the tfs power tools undo procedure above you need to do a get or get latest to update your screen. Otherwise it looks like undo has not worked. The operation completed successfully. Because the workspace Workspace;domain\userID is not on this computer, you must perform a separate get operation in that workspace to update it with the changes that have been made on the server.


关注公众号,不定期副业成功案例分享
Follow WeChat

Success story sharing

Want to stay one step ahead of the latest teleworks?

Subscribe Now