2

My folder structure is:

-- Solution folder

--- .tfignore file

--- folder for each project

But vs2015 keeps including my project.lock.json files in source control.

In my .tfignore file, I added: project.lock.json

I've tried undoing and deleting the files from source control.

How can I stop it from including project.lock.json?

Hoppe
  • 6,508
  • 17
  • 60
  • 114

2 Answers2

1

Simply update your VS to VS2015Update 3. The .tfignore should be indeed working correctly.

Or you can also use a temporary quick fix for the problem: Add an $ char into the bower_components folder name in the .bowerrc. TFS does not allow the $ character in the file name, so it can't be added to source control.

More detail info you can refer this blog from GitHub: Things in ".tfignore" still are shown in pending changes

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
1

As per the link in Patrick-MSFT's answer, this worked for me:

If the changes are "still" in pending changes, first create a backup copy, then make an Undo on them. Close VS, restore the backup copies and then it should work.

The other solution may work, but Visual Studio kept recreating the file as soon as I deleted it, which would immediately add it back to TFs. So I couldn't check in that change. Possibly closing the solution before making the change in the source control explorer, or using the TFS Power Tools shell extension, may work with the other solution.

Hoppe
  • 6,508
  • 17
  • 60
  • 114
  • Great, I was wondering if those files already in the pending changes before you add `project.lock.json` in your .tfigonre file. TFS will not ignore these .json files in this situation. – PatrickLu-MSFT Aug 12 '16 at 01:41
  • The sequence was: project.lock.json was a pending change. Added it to tfignore. Restarted computer. After an undo, it was automatically recreated and added back to TFS. Thank you for the help Patrick!. – Hoppe Aug 12 '16 at 11:51