How to undo pending changes in TFS of users that no longer exist
We have a few developers who don't work here anymore, but didn't check all theirs changes into Team Server before they left.
Now their usernames don't e开发者_JAVA百科xists anymore, and I can't access their pending changes to undo them....I found a way, not needing command line.
With Power Tools installed (both in 2008 and in 2010 version), Visual Studio shows a node for Team Members in each project. If you right-click on one of the members, you can choose to view all their pending changes. Till now nothing new. BUT, I suddenly saw, in the right hand upper corner of the pending change list, a link that says "Modify Query".
I opened the window, and in it was an input field that let me change the username. I changed it to the username I wanted, and I got his list of pending changes!
Here's a link to the TFS 2008 Power Tools:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0
and the TFS 2010 Power Tools:
http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
Edit by woppers:
I don't have enough Rep to comment so I have to make an edit. I had the same issue as the OP but I am working in TFS 2013 so the procedure is slightly different. Here's what I did.
Go to:
- Source Control Explorer
- right click on the collection you are working in
- Find
- Find Changesets...
- Enter your LanID in the “By user:” field
- Click search
- Click find
- That will show you all of your pending changes.
- Highlight one of them and click “Details...” to view the info in them.
As an administrator of TFS you should have some option of global check in.
something like that in the command line: tf lock /lock:none /workspace:workspace;username $/code/foo.cs /s:http://server:8080
or better yet:
tf undo /workspace:workspace;username $/code/foo.cs /s:http://server:8080
To expand a bit on the awesome answer provided by xr280xr... I needed to undo pending changes of a former employee, and this worked for me on a TFS 2013 server, using VS2015 on my own desktop:
- Right click the folder in Source Control Explorer > Find > Find by Status and enter * as a wild card. You can reduce the results to a specific user if you know the user name.
- When the results appear, you can right-click and select Undo. The Output window should confirm success.
Note that if the former employees' workspace is on another PC, you'll continue to see the pending changes they have, but they will no longer prevent checkout, build, etc. I'm guessing that deleting the former employees workspace will get rid of the pending (now-undone) changes, but I haven't tried it yet.
精彩评论