__pycache__
目录中的.pyc
文件也被追踪了。我意识到了这个问题,然后将*.pyc
和__pycache__
加入了.gitignore,但它们仍然被追踪。
然后我:
Tried to remove the tracked files:
git rm -r --cached . git add . git commit -m "fixed untracked files"
Checked my .gitignore. The encoding, according to
file -I .gitignore
, is.gitignore: text/plain; charset=us-ascii
. The .gitignore itself is:__pycache__ *.pyc buildSite/.DS_Store *.DS_Store .idea/ .idea/workspace.xml scratchFiles
There aren't any extra whitespaces or anything.
我仍然看到更改后的.pyc文件:
git status
...
modified: buildSite/builder/templatetags/__pycache__/class_tag.cpython-36.pyc
非常感谢任何建议!
git rm -r --cached .
命令之前,你是否提交了你的 .gitignore 文件? - Jonathan Lamgit rm -r --cached .
时,.
是否是正确的目录? - torek