gitignore just doesn't work. I can't get it to ignore .DS_Store & .gitignore files

前端 未结 10 802
心在旅途
心在旅途 2021-02-07 19:40

I have .gitignored .DS_Store and .gitignore files. But still see them in the \"git status\".

Can someone explain to me how I can m

相关标签:
10条回答
  • 2021-02-07 20:36

    I had an issue getting .DS_Store ignored where the problem was that it had already been committed to the repo. Removing it resolved the issue.

    $ git rm --cached .DS_Store
    
    0 讨论(0)
  • 2021-02-07 20:41

    I experience the same issue. The solution is to add a .gitignore under your home directory first.

    My end the repository .gitignore no longer appears in indexing tracking.

    0 讨论(0)
  • 2021-02-07 20:44
    1. You shouldn't ignore your .gitignore. I don't think the ignore feature works when you don't have it in your repository. I'm not sure though.
    2. Files that are already tracked won't be ignored, even if you add them to .gitignore. If you want them to be ignored after they've been added to the repository already, you have to remove them with git rm filename first.
    0 讨论(0)
  • 2021-02-07 20:45

    I faced the same problem. None of the .gitignore lines were in effect.

    I converted the file encoding into UTF-8 and it worked instantly.

    0 讨论(0)
提交回复
热议问题