.gitignore is ignored by Git

前端 未结 30 1389
梦毁少年i
梦毁少年i 2020-11-22 02:51

My .gitignore file seems to be being ignored by Git - could the .gitignore file be corrupt? Which file format, locale or culture does Git expect?

30条回答
  •  长发绾君心
    2020-11-22 03:20

    Even if you haven't tracked the files so far, Git seems to be able to "know" about them even after you add them to .gitignore.

    WARNING: First commit or stash your current changes, or you will lose them.

    Then run the following commands from the top folder of your Git repository:

    git rm -r --cached .
    git add .
    git commit -m "fixed untracked files"
    

提交回复
热议问题