Why doesn't Git ignore my specified file?

前端 未结 13 1529
野性不改
野性不改 2020-11-28 17:12

I added the following line to .gitignore:

sites/default/settings.php

but when I type git status it shows the file

13条回答
  •  醉梦人生
    2020-11-28 17:57

    Just in case anyone in the future has the same problem that I did:

    If you use the

    *
    !/**/
    !*.*
    

    trick to remove binary files with no extension, make sure that ALL other gitignore lines are BELOW. Git will read from .gitignore from the top, so even though I had 'test.go' in my gitignore, it was first in the file, and became 'unignored' after

    !*.*
    

提交回复
热议问题