0

I have a local .gitignore file in my repo's root folder with the content pasted from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

After I added the content, it ignored some of the checked out files, but they're still more than 200 files left as it can be seen on the screenshot.

enter image description here

I am using VS 2019.

What might be the problem?

EDIT: After I do git checkout ., I get "nothing added to commit" message, and then whenever I build, there are more than 200 modified files.

Georgi Vatsov
  • 428
  • 6
  • 10
  • 1
    The files were already added prior to you adding the `.gitignore`. Try searching. – CodeCaster Nov 28 '19 at 15:55
  • No. I start with no checked out files and existing .gitignore and whenever I execute a build the files are checking out. – Georgi Vatsov Nov 28 '19 at 15:58
  • _"I start with no checked out files"_ - that's TFS terminology. You're not on TFS, you're on Git. You have a branch checked out, and that branch already tracks files that you now want ignored. Do a `git status` from the command line and you'll see. The fact that those files are listed under "changes" proves that they are currently being tracked by Git. – CodeCaster Nov 28 '19 at 15:59
  • Sorry for my TFS dialect. After I do `git checkout .`, I get `nothing added to commit`, and then whenever I build, there are more than 200 modified files. Can't put it clearer than that. – Georgi Vatsov Nov 28 '19 at 16:03
  • 1
    _"there are more than 200 modified files"_ - that is **because they were already added to source control before you added the `.gitignore` file**. See duplicate linked above to remove them from source control. – CodeCaster Nov 28 '19 at 16:04
  • Yes. This resolves it. Sorry for my ignorance. I read the thread you pointed, but never realized this was my problem. – Georgi Vatsov Nov 28 '19 at 16:11
  • No problem, happy to help. – CodeCaster Nov 28 '19 at 16:26

0 Answers0