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
  • 18,115
  • 12
  • 85
  • 125
I_Debug_Everything
  • 3,766
  • 3
  • 33
  • 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
  • 15,727
  • 6
  • 44
  • 82