12

I have a .tfIgnore file like below whihc is already checked-in

\xx.Phoenix.Web\bower_components
\xx.Phoenix.Web\node_modules
*.autogen.cs

I would expect that everyfile which is match with .autogen.cs be ignored. But the problem is when files are generated by t4 templates, file are shown in pending changes, see below picture, xx.autogen.cs is recognized as add

enter image description here

even I tried below but still not working

Phoenix\Domain\Entities\*.autogen.cs

and

\Phoenix\Domain\Entities\*.autogen.cs

We are using Vs2013 + Tfs2017

Reza
  • 18,865
  • 13
  • 88
  • 163

2 Answers2

9

Go to Source Control Explorer and delete the folder or file which you want to ignore.

zx485
  • 28,498
  • 28
  • 50
  • 59
Abdullah Nurum
  • 305
  • 2
  • 9
  • 1
    I did it before, it wasn't working, the issue was for using vs2013, now we are using vs2017 and it's working as expected – Reza Feb 21 '18 at 14:28
  • 1
    This worked in my environment - normally, I would expect this to delete the files from the disk, but they remained, and were excluded from tf – Matthew Beck Oct 30 '18 at 23:25
8

First, please make sure your .tfignore file created without any problem. This file does not have any suffix. Details of how to take a look at my reply in this question.

Also check if the files already in source control. If they are, .tfignore won't apply to them.

A way to solve the issue is updating your VS to VS2015Update 3. The .tfignore should be working correctly. You could give a try with this version which have some improvements with tfignore.

More ways for handling the issue you can refer this blog from GitHub: Things in ".tfignore" still are shown in pending changes

ry8806
  • 2,258
  • 1
  • 23
  • 32
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thanks for answer, .tfIgonre is created from "exclude files" context menu, and it's under source control. The only thing is we are using vs2013 in our company and we can't update to vs2015Update3 right now, so it seems that it's a known issue? – Reza Mar 02 '17 at 13:01
  • If the `.tfignore` works with other files and folders just not work with @RezaRahmati `*.autogen.cs`. Maybe it's the defects of Team Explorer and VS for 2013 version. Give a try with this workaround add an `$` char into the entities folder name. TFS does not allow the $ character in the file name, so it can't be added to source control. Otherwise, you may have to manually exclude this file for now. – PatrickLu-MSFT Mar 03 '17 at 10:42
  • That link to the cited Git Hub blog is invalid. Assume you mean this link with the same document title: https://github.com/aspnet/Tooling/issues/18 – ajb101 Jul 26 '17 at 12:37
  • 1
    `Also check if the files already in source control. If they are, .tfignore won't apply to them.` - Is it possible to ignore such files anyway? – neleus Sep 27 '17 at 07:03
  • 1
    @neleus For this kind of files, you need to delete/destroy those files in source control, then check in the `.tfingore` file. Next time when you check in the files again, it will also auto excluded in VS IDE. – PatrickLu-MSFT Oct 09 '17 at 01:31
  • Unfortunately I cannot delete them in tfs. My files are configs and needed for deploy – neleus Nov 21 '17 at 12:36