【问题标题】:Git history cleanup doesn't seem to have an effectGit历史清理似乎没有效果
【发布时间】:2010-06-07 21:43:38
【问题描述】:

我运行了以下 2 个命令来清理我的 git 存储库中的 .pbxuser 和 .mode1v3 文件,但之后当我例如启动 gitx 我仍然可以在历史记录中看到它们。

git filter-branch --tree-filter "git rm -rf --cached --ignore-unmatch *.pbxuser" HEAD
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune

我在这里误解了什么?这些命令似乎可以完成这项工作,但为什么 gitx 仍在查看其历史记录中的差异?

问候,埃里克

【问题讨论】:

    标签: xcode git


    【解决方案1】:

    尝试克隆已清理的存储库,并查看 gitx 是否仍查看该(克隆的存储库)历史记录中的差异。
    (见“Remove a directory permanently from git”)

    【讨论】:

    • 谢谢,我会试试的。抱歉,之前没有发现这个问题的双重帖子。
    • 似乎我的过滤器命令在某种程度上是错误的。您链接问题的命令完成了这项工作。谢谢!
    • @eaigner 所以你不需要克隆回购?只过滤分支和 gc 修剪?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-12
    • 2018-05-18
    • 1970-01-01
    • 2010-12-24
    • 2020-07-04
    相关资源
    最近更新 更多