git still shows files as untracked despite .gitignore and rm -r --cached. What did I do wrong?

后端 未结 1 1695
有刺的猬
有刺的猬 2021-02-14 04:22

I\'m not sure what I\'m doing wrong in this case with my .gitignore file, but these files keep showing up.

Background

I\'m using Jekyll to build a blog. Jekyll

1条回答
  •  被撕碎了的回忆
    2021-02-14 04:55

    Your .gitignore file is currently detected as UTF-16LE encoded. Changing encoding to UTF-8 is the solution.

    To fix:

    • Open the .gitignore file in a text editor such as Notepad++
    • Change the encoding (in np++, this is via the Encoding menu) to UTF-8 without BOM
    • Save the file.
    • Add the .gitignore file into staging
    • git commit -m "fixed ignore file"

    At this point, the ignore file should start working correctly.

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