【问题标题】:gitignore failing to ignore .pyc files in librarygitignore 无法忽略库中的 .pyc 文件
【发布时间】:2019-06-21 14:18:47
【问题描述】:

我的 gitignore 有以下几行

__init__.cpython-36.pyc
functions.cpython-36.pyc
.DS_Store
__pycache__
*.pyc

但我的 git 客户端仍在注册对 pyc 文件的更改

在线阅读后,我只是不明白我的问题是什么。有任何想法吗?如果我需要提供更多信息,请告诉我。谢谢

【问题讨论】:

标签: git gitignore pyc


【解决方案1】:

在您创建 .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.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-16
    • 2014-07-06
    • 1970-01-01
    • 1970-01-01
    • 2019-09-12
    • 1970-01-01
    • 1970-01-01
    • 2019-04-29
    相关资源
    最近更新 更多