Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are "Excluded Changes" in Team Foundation Server?

When I check in changes in TFS Express 2013 using Visual Studio 2013 Professional, there is a list of "Excluded Changes" that has 1541 items in it.

I have never told TFS to exclude a change, and do not understand why anyone would even want to "exclude" a change (isn't source control all about SAVING changes???). I am a bit worried that I have changes that are not being saved...but am even unsure if this is even what it means. I have Googled for more information about "Excluded Changes" in TFS, but haven't found any explanation.

Can anyone explain to me: What are Excluded Changes? Why would I want to exclude a change? And why are there 1541 excluded changes that I never requested to be excluded? Should I be worried that changes are being excluded? Should I change these excluded changes to INCLUDED changes?

like image 333
Joe Gayetty Avatar asked May 12 '15 16:05

Joe Gayetty


People also ask

What are excluded changes in TFS?

This is to prevent you from accidentally checking in stuff that you did not intend to. In Git you need to explicitly call git add to mark a change as one that you intend to commit. Until you do that the change is considered "untracked", which is essentially the "Excluded Changes" feature of TFVC.

How do you check changes in TFS?

In the team explorer open up the source control tab, then right click on the route folder and select Check in Pending Changes. This will check in all the files over all the solutions/projects that you have underneath the root. Repeat the process for any other team collections you have used.

What is undo pending changes in TFS?

To undo all changes you have made in your solution or a code project, open the context menu, and then choose Undo Pending Change. In the Undo Pending Changes dialog box, make sure the changes you want to undo are selected, and then choose Undo Changes.

What is the use of Team Foundation Server?

Team Foundation Server (often abbreviated to TFS) is a Microsoft product that provides tools and technologies designed to help teams collaborate and orchestrate their efforts to finish projects or create a product. It enables DevOps capabilities covering the entire application lifecycle.


1 Answers

There are a number of things that can cause a "change" to be excluded:

  1. Team Explorer will, by default, ignore files in obj/* and bin/* and a few other folders. As well as certain extensions like .csproj.user.
  2. They're not loaded in your current solution, so Team Explorer assumes they're made as part of either a different solution and that you don't want to check them in together with the changes that do match the context you're in.
  3. They're made in a different workspace, again Team explorer assumes you want to check in groups of files that logically make sense.
  4. They're manually excluded from the current checkin. You may do that when you want to first check in one file that fixed Bug 123, then check in another set of files that fixed Bug 124.
  5. Files created outside of Visual Studio are never automatically added, so when you zip up a set of .cs files and that zip ends up in your workspace folder, Team Explorer will detect it, but won't add it automatically.
  6. There is a final issue that may be going on here, if for some reason a project hasn't been added to source control, or the bindings in the solution file were not checked in correctly, then any file added to that project will be ignored as well, as Visual Studio assumes that project should not be under sourcecontrol.
  7. Using "Add existing project" doesn't automatically put that project under the same source control bindings as the solution. which would cause team explorer to assume 6.
  8. The path may previously have been "cloaked" or "unmapped", mapping a folder after the fact doesn't tell Team Explorer to add them.
  9. You may have been working offline and were using a server workspace. When you tell Team Explorer to come back online, you need to ensure that all adds are correctly done. A Local workspace doesn't have this issue, as it can locally track the changes without having to talk to the server.
  10. You may have chosen "Check in pending changes" from a subfolder in the Solution Explorer (or on an individual item or project) or in the Source Control Explorer. When you do that, Team Explorer scopes the Pending Changes window to only the items that match that context. All other changes are temporarily moved to the "Excluded Changes" section.

You should inspect the Excluded Changes list and either ignore them using your .tfignore file. You can do this from the UI as well by right-clicking such an excluded change and choosing the option to ignore by path/extension or pattern.

enter image description here

Basically, if you see stuff in the Excluded Files section, either right-click/include them or add them to your .tfignore file.

That way it's at least very clear that items in that list have not been evaluated yet and most probably need to be included.

You may also want to check your source control bindings by opening File/Source Control/Advanced/Change Source Control Bindings... to ensure that all projects show as bound to sourcecontrol and don't show any errors.

Some additional context

In Git as well as in other source control systems, changes are often not automatically pended. This is to prevent you from accidentally checking in stuff that you did not intend to. In Git you need to explicitly call git add to mark a change as one that you intend to commit. Until you do that the change is considered "untracked", which is essentially the "Excluded Changes" feature of TFVC.

Subversion (SVN) has a similar behavior where changed files are marked as unversioned and need to be added explicitly through calling svn add.

So this isn't very strange behavior for a source control system. It essentially puts you in control of your sources.

like image 107
jessehouwing Avatar answered Oct 01 '22 01:10

jessehouwing