"tf status" to see pending changes without "detected" adds - tfs

I want to use TF.EXE to get a list of the pending changes in my source branch. I want the same list I see in Visual Studio's "Pending Changes" window.
For instance, I current have 167 pending changes shown in the Pending Changes window, about 50/50 edits and adds. Under Excluded Changes, there is a button titled "Detected: 49998 add(s)". These are literally tens of thousands of intermediate/output files in my solution directory that are not under source control, which I don't want under source control, and which are not "Pending Change" by any definition of that term.
However, when I do tf status in my solution directory, it shows me all these files as adds. How do I get just the list of Pending Changes shown in Visual Studio (i.e the files that will actually be checked-in when I submit changes)?
Alternatively, some way to copy the list from the Visual Studio UI. I just want to put this list in an email, but the UI is horrible (won't expand to use available vertical space, can't copy text, etc.) and the command line gives me garbage.
(EDIT) Solution: tf checkin /recursive, select items in list and hit CTRL+C to get list on clipboard.

You are looking for the check in window such as this question: VS2012 return to a normal TFS checkin window?
You could use tf check in command with the prompt window, should be able to copy the list in the E-Mail then. Another method is using TFS api to do this.

Some years later but might still be useful for someone:
tf status -nodetect

Related

How do I hide files in Team Explorer Pending Changes View?

I am using Visual Studio 2107.
Looking at the “Pending Changes” panel in Team Explorer, there are two list for “Included Changes” and “Excluded Changes”.
I can use the Filters option to display only files that match a certain pattern. However, I want to be able to hide files that match a certain pattern.
The reason is that I have a number of files regenerated during the development process; these files all have the same name in different projects. They clutter up the list when I am reviewing what to check-in.
Note that I don’t want to exclude these files from being checked-in; they will be checked-in to source control eventually. I just want to be able to review the Changes list without these files displayed until I want to see them.
It seems straightforward but I can’t seem to figure out how to do it. And I can’t seem to find the right phrasing for Google.
How do I hide files in Team Explorer Pending Changes View?
If you don’t want to exclude these files from being checked-in, I am afraid you could not hide files in Team Explorer Pending Changes View.
According to the document Develop code and manage pending changes:
Almost every change that you make to the files on your dev machine is
stored in your workspace as a pending change until you check it in.
If items that you don't need to check in appear regularly in the
Promote Candidate Changes dialog box, you can select one of them, open
its context menu, and choose Ignore this local item to ignore the
item. You can also choose Ignore by extension or Ignore by file name
to create a file that will cause Visual Studio to systematically
ignore this kind of file.
So, Pending changes will detect all your changed files unless you don't want to check them in.
So, to hide files in Team Explorer Pending Changes View, we need to use .tfignore file to ignored files to folders that are mapped in a local workspace, they do not appear in the Pending Changes page in Team Explorer. When you want to check them into source control, you can move them out from .tfignore file.
Hope this helps.
Hiding files from Pending Changes is not supported without fully ignoring them.

Team Foundation Server - Viewing files in the last commit for a user

I want to know how to view a list of all files that was committed by a user in their last commit. Not all files committed by them just the ones which were committed in the last batch. For example, suppose I just committed 10 files in TFS and now I want to view the list of just those 10 files.
How do I do that?
Thanks,
-R
In visual studio 2010 you can also go to file, source control, changesets and search for changesets from this windows. You have the option of applying filter on changesets by users, or by date or by change set ids. Get the results and you can double click to see the files that are part of the changesets displayed in a new window.
Or you install Team Foundation Sidekicks and go over the shelveset sidekick menu and get this screen
Ok got it.
Open any single file that you remember being part of the changeset in Visual Studio. Right click the file, go to source control and click on view history. Select the version you committed and right click then select view changeset details.
-R

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 exists 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.

How to undo another user’s checkout in 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 checked into source control.
How do you undo another user's checkout?
There are at least 2 different ways to do this:
Command Line
There is a command-line utility called Tf.exe that comes with Team Explorer. Find the documentation here. It can be accessed by launching a Visual Studio Command Prompt window. The syntax of the command is:
tf undo [/workspace:workspacename[;workspaceowner]]
[/server:servername] [/recursive] itemspec [/noprompt]
For one file
tf undo /workspace:workspacename;workspaceowner $/projectname/filename.cs
GUI
The second is via the GUI, but does not come standard - you have to install the TFS Power Tools. See here for details on how to use this method.
Keep in mind that with either method 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
Deleting the workspace
tf workspace /delete WorkspaceName;User
/server:http://server:8080/tfs/MyTeamCollection
The easiest way I found is to use the free TFS Sidekick application. It has an option to view and undo other user's checkout.
I just had this problem myself and found an easier way to clean up old workspaces.
In Visual Studio, open Source Control Explorer.
From the 'Workspace' drop-down select 'Workspaces...'
A dialog will appear showing the workspaces on your current PC. Select 'Show remote workspaces'
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.
Select your file in TFS sidekick, then above the list, you have a "undo pending Change". Click on that and the change will be undone :)
The icon is similar to the "Undo" icon in MS word
Get TFS sidekicks from http://www.attrice.info/cm/tfs/index.htm

TFS shows some pending changes under my name, but I have not changed anything

TFS shows some pending changes under my name, but I have not changed anything. When I check in and see View Pending changes, I see some of the changes which I have never made, changes pending under some other user might be shown as my pending changes. When I unselect and check-in my changes, these are still locked under my name? Is this due to auto-checkout or any other reason? (TFS policy requires a compile before check-in)
This is probably due to the automatic checkout feature in TFS.
TFS uses an atomic check-in process and is very careful about recording who did what. When you start editing a file (or the IDE edits one on your behalf, for example a .csproj or .vbproj file) then the file will show up in your pending changes list to show you that you have the file checked out with an edit pending.
To see your pending changes list, go to View, Other Windows, Pending Changes in Visual Studio.
To check-in any pending changes you can right click on the file in solution explorer or you can select it in the pending changes view. Only then will the change be committed into version control. From the pending changes view you can compare with the server version to see what changes you have made.
To see the changes that have been committed to the server you can right click on a file or folder and select "View History".
If you want to remove the pending change and restore the file to what it was before you edited it you can right click on the file and select "Undo Pending Changes".
If you want to change the auto check-out behaviour to prompt you before it performs a check-out, then go to Tools, Options, Source Control, Environment and change the Checked-in items for Saving and Editing to "Prompt for check out" rather than the default which is "Check out automatically".
Hope that helps,
Martin.
I've had a similar issue; TFS still says I've got pending changes that when I compare declares as being identical. This post comes up with a way to prune out all the identical ones and to leave you with only the files that actually have changed.
The problem might have to do with different workspaces that you use or have used possibly on different computers. Check the workspaces that exist and see if the files are checked out anywhere else. Here the sidekick tool mentioned in a comment can help.

Resources