【问题标题】:Find the process updating a file in OSX在 OSX 中查找更新文件的过程
【发布时间】:2018-11-05 05:07:36
【问题描述】:

我的 git 存储库中自动修改了一些文件。 git status 将它们显示为已修改。当我执行git reset --hard HEAD 时,这些文件仍显示为已修改,当前时间仍显示为已修改时间。

可能某些进程正在修改它们。如何知道发生了什么?

【问题讨论】:

    标签: git watch


    【解决方案1】:

    检查涉及 eol 的差异(行尾:lf vs. crlf),如I do here

    git -c color.diff.whitespace="red reverse" diff -R -- aChangedFile
    

    如果建议将core.autocrlf 设置为false,并尝试设置为renormalize the index (Git 2.16+)

    git add --renormalize .
    

    然后检查您的git status

    【讨论】:

    • 不是 crlf 问题。似乎有一些进程正在更新文件。这些变化并非微不足道。差异中有一些有意义的内容。
    • @ShashwatKumar 你有这种修改的例子吗?你在使用 XCode 吗?你用的是什么版本的 Git?
    猜你喜欢
    • 1970-01-01
    • 2010-09-28
    • 1970-01-01
    • 1970-01-01
    • 2015-09-27
    • 1970-01-01
    • 2014-06-27
    • 2016-02-06
    • 1970-01-01
    相关资源
    最近更新 更多