Sometimes you need a directory or some files within your Visual Studio Solution that you do NOT want to check-in into TFS Source control.
However, Visual Studio will detect the files and Team Explorer will show you that there are detected changes:
These files are not only annoying but also confusing to some developers.
Using a “.tfignore” file you can instruct TFS to ignore these files.
If you are using TFS2012 you need to manually create the file. If you are using TFS2013 you can create it via context menu (find instructions below).
Just include a file that is called “.tfignore” into a folder. It will be in effect for the current folder and all its children. However, you can create another file in a subfolder that will undo the effect of the first file.
An example file could look like this:
More details can be found here:
If you are using TFS2013 you can use the context menu to create the file. Just open the team explorer and click on the “Detected: 505 Add(s)” link. This will open the “Promote Candidate Changes” dialog.
In this dialog, right clicking one or multiple items will open the context menu where you can exclude files by name, extension or folder.
This action will create a .tfignore file for you:
You can now go ahead and modify the file to your needs.
With this file in place, whenever you add files to a folder outside of visual studio, Team Explorer will just ignore them.