TFS: Why does it show my pending changes depending on what project I have open? - tfs

I'm working in a solution with multiple projects in it. If I make a change to a file in project Test1, unload that and then load project Test2, my edits that I made in Test1 disappear from my pending changes on TFS. If I reload Test1, it reloads my pending changes.
Another thing I've noticed is that my TFS used to carry pending changes across solutions. For example I make a change in my Client solution, I then close that and open my Sales solution and my pending changes from my Client solution disappear until I reopen it.
Is this normal or is there an option I've clicked?

Related

TFS - How to work with multiple computers on same workspace without checking in my code everyday

I work both from the office and at home, using separate computers. Currently, to be able to continue coding from home, I need to check in all my code before leaving the office. Is there any way of making my workspace work completely online, so that I can continue my work from home without checking-in anything when I'm leaving the office?
I'm currently trying a trick; mapping my workspace on a shared folder (network drive) which I can also access from home via VPN too. But it's taking too long to even download the latest version of the project. Even if this works, I don't think it will be an efficient way because of network speed limitations.
Is there any solution for multiple computers, one user and one workspace?
Assuming that you are using TFVC rather than Git for source control in TFS, then you can shelve your changes rather than checking them in.
Got to the Pending changes area of Team Explorer and click on the shelve drop down.
You now have a couple of options. You must add a name then you can select
preserve pending change locally. This allows you to keep your
changes in the machine you're currently working on.
Evaluate policies and notes. This is only necessary of you have check in
policies set up and it can be ignored if you just want to store your
changes as they are not complete and applying policies at this time
might be inappropriate
Once you have done this then hit shelve. You changes are now stored on the server. When you get to your other machine go in to "Pending Changes" and select the Actions drop down and select "Find Shelevesets"
This will present a list of shelvesets committed by you. You can search for shelvesets by other users but in this case the most recent shelveset created by you should be at the top of the list.
Right click on the appropriate shelveset and select "unshelve". You should now be able to continue working where you left off.

Is there a way to clear all of my TFS pending changes?

If I unshelve a shelveset, the "Pending Changes" toolwindow in Visual Studio will restore the files, the commit comment, and the associated work items I had set up when I shelved.
If I change my mind and decide I'm not ready to work on this shelveset right now -- for example, if I have to drop everything and fix a bug -- is there any way I can clear all of this state at once?
It's easy for me to highlight all the files, right-click, and "Undo". But that only reverts the files; I still have to go in and erase the comment, then switch to the Work Items page, possibly select a different query to make sure I see the work item that I was associated with, and uncheck the box.
Is there a button, menu item, or VS extension that will let me revert the file changes and the commit comment and the list of work items, all at once, and leave me with a totally clean slate to work on something else?
I am not at the office to check this out, but it's worth a shot: Shelve your changes into a new shelveset, keeping in mind to uncheck the "Preserve pending changes locally".
In the next version of Visual Studio it will be a much nicer experience. Check out the session by Jamie Cool on this topic

How do i remove files from the Pending Changes list in TFS when those files weren't in the source yet and have been deleted locally

Someone added a workspace incorrectly, so after I fixed it TFS thought I had added some files to the project (dll, pdb, and xmls). So I tried just deleting the files and refreshing the pending changes. I tried clicking undo, but the Output window says
No pending changes were found for
$/SourceCode/Apps/.../Lib.dll.
(I replaced part of the full path here).
So the undo won't do anything.
I tried "Refresh Status" under File-> Source Control after every step.
I tried re-adding these files and then doing the undo.
So for example I am stuck with
Name Change
UI.xml add, lock
Design.dll add, lock
and can't remove them.
Any suggestions are appreciated.
Thanks!
Don't delete. Once you "add" them to TFS, it creates an entry in the database just waiting for the files. Instead, undo your "add."
That's actually how to fix this problem as well.
Right click on any source file in the source explorer, and choose Undo Pending Changes. Uncheck everything except for the two files that you need to get rid of the add. Click OK to undo those changes.
That will clean up everything in the TFS database.

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.

Source Control Explorer Shows Pending Changes, But In Pending Changes Window does not show

In TFS Source Control Explorer it shows pending changes (edit,[more]) with my name, but the Pending Changes window does not show any pending changes.
What I thought is, months ago my Visual Studio crashed, and at that time some files were checked out (which I was not aware of, due to the automatic checkout nature of TFS). Due to that, I copied a new VMImage, without undoing the pending changes (which are currently showing in Source Control Explorer).
One of my team members wants to checkin a new version of that particular file. Now, I need to undo my pending changes.
It sounds like you have them checked out under a different workspace. Try going to View->Other Windows->Source Control Explorer, then open the Workspace dropdown near the top of the screen, and select "Workspaces..."
I would suggest simply deleting any extra workspaces shown.
Steps to reproduce:
Make non-conflicting edits to files in TFS.
Get the latest version of the project from source control.
Sometimes, pending changes will be marked as non-pending and all project files are saved, resulting in no pending changes in the Team Explorer.
Workaround:
Right-click on the solution folder in source code explorer
Select "Compare"
In the search results, manually open files which have been edited/added and save them. This will register them as a "Pending Change" in team explorer.
This is because TFS apparently uses file properties rather than actual text comparisons to register pending changes in Visual Studio.
Tested on: Windows 7, Visual Studio Ultimate 2012.
Additional feedback from my supervisor: "Not sure if it was the issue this time, but that can happen when you disconnect from the TFS server (which sometimes happens without it being obvious). File | Source Control | Go Online usually fixes it (and the option isn’t available if you are online)."
TFS is buggy everywhere. i think you need to check out the parent folder and use TFS power toys to undo all the rubbish unchanged item.
TFS use file property to indicate whether or not a file has change, which sucks the most, and produce tons of usability problem.
If the file that you checked out is not part of the current solution, it might be hidden by the "Filter by solution" toolbar button on the Pending Changes window.
Get your changed files check out for edit
I had the same problem, I re-started VS, opened the solution and all the changes are now being displayed in the pending changes window.
Did you try to checkout the file from the Source Control Explorer view ?
For me, it worked.
I have just had a similar issue in VS2012.
To resolve the issue, I toggled the "Show xxx" dropdown to "Show Solution Changes" and then back to "Show All". The files that were missing from the list then re-appeared.
I was having a similar problem and it was due to the fact that my local version was a "non-version control solution" for some reason! meaning that my local was not really connected to the actual source code on tfs.
fix: Got the latest with override option checked. I know this could be painful if you had a lot of changes made to your local.
I was facing same issue the first answer was really helpfull. But make sure to check "Show Remote Workspaces" if you are working from different computer. In my cases the files where checked in and edited from home computer and it was showing pending changes. Deleting unwanted workspaces helps to solve this problem.
a different workspace on the same machine
a different workspace on another machine
TeamExplorer -> PendingChanges -> Excluded Changes ( I included this only because you didn't specifically mention they weren't there)
especially if you right clicked a node in solution explorer and chose check-in
Filtered based on TeamExplorer Settings #Oliver
Use a Tfs Query to find the pending changes and what workspace they are pending from.
Another option is to permanently or temporarily give them permissions to overwrite your lock. Then he can check-in anyhow.
I've seen this problem. Sometimes when I have the pending changes window in 'flat display mode', it doesn't display my changes. I find if I click the toolbar icon at the top of the pending changes window with tooltip 'Change to folder view', then they display. I think this is a bug in the Team Explorer Client.
sometimes I can not lock a branch because users have things checked out, but when I ask them about it, the pending merges/changes, only folders come up with no objects to change. What's with that?

Resources