Git ignore is not ignoring the netbeans private files

后端 未结 2 638
既然无缘
既然无缘 2020-12-16 03:16

When ever I do git status, the netbeans private.xml is making trouble, I tried adding that in git ignore several ways. but the gitignore simply does not ignore it.



        
2条回答
  •  隐瞒了意图╮
    2020-12-16 03:29

    A file which is already tracked would not be ignored: you need to remove from the index first.

    git rm --cached private.xml 
    git add -u .
    git commit -m "Record deletion of private.xml from the index"
    

    (the --cached option make sure the file remains on the disk)

    Then you can add it in the .gitignore (no need for '*')

    private.xml 
    

    Note: whenever an file is or is not ignored, you can check out which .gitignore rule applies with:

    git check-ignore -v -- private.xml
    

提交回复
热议问题