1

I have the following contents in my .gitignore file

**/*.txt
**/*.out
**/*.DS_store
**/*.exe
**/a.out

However, every time I compile my c++ files I get a.out files as executable and I still get file as modified when I do git status. I'll be thankful if someone can point me in the right direction.

edi9999
  • 19,701
  • 13
  • 88
  • 127
I_Debug_Everything
  • 3,776
  • 4
  • 36
  • 48

1 Answers1

1

Looks like you have accidentally added the file to the index. You can remove it from the index using:

git rm --cached a.out

Git will no longer track this file.

From the manual:

--cached

Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.

sergej
  • 17,147
  • 6
  • 52
  • 89