【发布时间】:2019-06-21 14:18:47
【问题描述】:
我的 gitignore 有以下几行
__init__.cpython-36.pyc
functions.cpython-36.pyc
.DS_Store
__pycache__
*.pyc
但我的 git 客户端仍在注册对 pyc 文件的更改
在线阅读后,我只是不明白我的问题是什么。有任何想法吗?如果我需要提供更多信息,请告诉我。谢谢
【问题讨论】:
我的 gitignore 有以下几行
__init__.cpython-36.pyc
functions.cpython-36.pyc
.DS_Store
__pycache__
*.pyc
但我的 git 客户端仍在注册对 pyc 文件的更改
在线阅读后,我只是不明白我的问题是什么。有任何想法吗?如果我需要提供更多信息,请告诉我。谢谢
【问题讨论】:
在您创建 .gitignore 之前,该文件已被跟踪。在那里面
如果您需要取消跟踪它:
git rm --cached ...
来自man git-rm:
--缓存
Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.
【讨论】: