-1

I am trying to ignore some files from my project. I have the following extensions in .gitignore

*.opensdf
*.sdf
*.tlog
*.cer
*.cat
*.inf
*.tmh
*.inf

I see the following file is ignored

D:\Projects\driver1\driver1\inter\Win32\Win7Debug\link.command.1.tlog 

but the following file is seen as Modified, thus this one is not ignored.

D:\Projects\driver1\ioctlapp\inter\Debug\link.write.1.tlog

Why the second file isn't ignored and how can i fix the problem?

I took only 2 files from both, from ignored and not ignored files, but there are more files which I expect to ignore and they aren't.

Martin Rezyne
  • 445
  • 3
  • 9
  • 24
  • Might be that the second file is already a tracked file? If so, it will not be ignored. – Eldad Assis Oct 13 '15 at 11:10
  • 1
    Possible duplicate of [Applying .gitignore to committed files](http://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files) – edi9999 Oct 13 '15 at 11:45

2 Answers2

3

That's most probably because you committed it before adding *.tlog in your .gitignore.

Use git rm to remove it from git and the commit the changes:

 git rm D:\Projects\driver1\ioctlapp\inter\Debug\link.write.1.tlog
 git commit -m 'Removed link.write.1.tlog'

Next time when you will edit it, it will be ignored.

Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474
0

First check if file is tracked git ls-files --error-unmatch file_name If you don't see error, then it's tracked. Remove it from index but not from disk with git rm --cached. After that commit that change. Let me know if it helped you.

grimsock
  • 774
  • 5
  • 18