-1

I want Git to ignore all files named build-impl.xml in my project.

To do this I added *build-impl.xml to .gitignore

However Git still shows the files as being modified:

$ git status    
modified:   TMA02Q1Server/nbproject/build-impl.xml
modified:   TMA2Q1Client/nbproject/build-impl.xml

What am I doing wrong?

Edit: I was not aware the files were being tracked - by asking this question I was helped to understand why I wasn't getting the result as expected. This question may help people in a similar situation.

NRKirby
  • 1,584
  • 4
  • 21
  • 38

1 Answers1

6

.gitignore does not apply to files that are already being tracked.

If you delete the file from disk, commit it, and then restore the file to its original location, git will stop tracking it.

Or, run git rm --cached TMA02Q1Server/nbproject/build-impl.xml

dcastro
  • 66,540
  • 21
  • 145
  • 155