13

I am using Visual Studio Team Services extension in VS code for check in. https://marketplace.visualstudio.com/items?itemName=ms-vsts.team

I am now trying to check in change in angular project, but I am annoyed by excluded 16000 files which are from node_modules: enter image description here

How can I exclude those files from source control? In Visual Studio I used .tfignore file, how about vscode?

poke
  • 369,085
  • 72
  • 557
  • 602
sensei
  • 7,044
  • 10
  • 57
  • 125

2 Answers2

10

I had the same problem creating a dotnet core 2 cli react project using visual studio code and TFVC. I created a .tfignore file in the root (same place as the .gitignore).

Then I copied the content in the .gitignore file into .tfignore file, save and done...

ShaneRoode
  • 300
  • 4
  • 8
  • 3
    To expand on this, within the `.tfignore` file, you need to add the following entry: `\node_modules` – Flea Sep 21 '17 at 20:35
  • I'm not using git, nor do I have a .gitignore file. I'm using TFVC, and I've deposited a .tfignore file in the root of my folder, along side a single file I hope to ignore: firmware.bin. The .tfigore file seems to be ignored, and firmware.bin still shows in the "Excluded Changes" group in source control. Any ideas? – JohnKoz Sep 30 '17 at 12:48
  • Note: the .gitignore file is created by the angular cli. It doesn't mean you selected the wrong option when connecting to your source control. I just copied the file over directly and it seemed to work - I don't believe any conversion is required. – Simon_Weaver Jun 12 '18 at 05:11
1

So I followed everything that the others mentioned, but was missing the following, for .tfignore to skip the files:

Place the following in you Visual Studio Code's settings.json file.

"tfvc.restrictWorkspace": true

settings.json location:

File - Preferences - Settings (top right-hand corner(Open Settings (JSON)))

That I found the answer here.

Elmer
  • 384
  • 5
  • 19