git - 即使统计信息可能没有更改,如何让 git 检查每个文件的内容?

标签 git

我使用 git 将代码分发到嵌入式系统。有时文件会在不更改 mtime 的情况下损坏,我想重新检查所有内容。 Git 通常不会检查统计信息未更改的文件的 sha。我怎样才能让它检查?

我试过

git -c core.ignorestat=yes reset --hard

但这不起作用。

最佳答案

尝试将 core.trustctime 设置为 false:

core.trustctime

If false, the ctime differences between the index and the working copy are ignored; useful when the inode change time is regularly modified by something outside Git (file system crawlers and some backup systems). See git-update-index(1). True by default.

(我还没有尝试过这个,但看起来它可能会成功。)

关于git - 即使统计信息可能没有更改,如何让 git 检查每个文件的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9321253/

相关文章:

git - 如何防止我的 git 损坏?

git - 尝试模拟 git merge 冲突

python - 如何使用 `pip install git+ssh` 安装附加功能?

git - 为什么是 "git push helloworld +master:master"而不是 "git push helloworld"?

git - “git fetch --tags --force”和 “git pull <branch>”是可交换的操作吗?

git - git 中的全局和本地配置有什么区别?

r - 如何从 R 脚本中将更改提交到 GitHub?

从内部目录使用时 git add 不添加更改

Gitolite 一个用户 - 许多键 - 不同的用户名

git - 同步两个 git 存储库 Jenkins Pipeline