【问题标题】:Definitively delete the tracking of .DS_Store files in GIT [duplicate]明确删除 GIT 中 .DS_Store 文件的跟踪 [重复]
【发布时间】:2013-11-17 15:24:40
【问题描述】:

我有一个 git 存储库,其中已经跟踪了 .DS_Store 文件。有没有办法完全忽略每个文件夹中的主题?

我知道在被跟踪之前我可以简单地将.DS_Store 放入.gitignore,但我也知道如果.DS_Store 已经版本化,它就不起作用了。

【问题讨论】:

    标签: git


    【解决方案1】:

    您需要使用git rm 以某种方式删除它们。当然,这可能比手动浏览它们更容易:

    find -name .DS_Store -print0 | xargs -0 git rm
    

    【讨论】:

      【解决方案2】:

      您需要使用 git rm 从 repo 中删除它们,然后提交更改。

      git rm --cached "*.DS_Store"
      git commit -m "remove all .DS_Store"
      

      【讨论】:

        猜你喜欢
        • 2016-02-27
        • 2018-07-21
        • 2017-05-10
        • 2011-11-27
        • 2017-10-23
        • 2012-02-07
        • 2014-08-09
        • 2016-02-07
        • 2020-11-18
        相关资源
        最近更新 更多