git
runtime_error
ai_generated
true
警告:检测到时钟偏差。您的构建可能不完整。
warning: clock skew detected. Your build may be incomplete.
ID: git/warning-large-filesystem-time-skew
90%修复率
85%置信度
1证据数
2023-09-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| git 2.20.0 | active | — | — | — |
| git 2.38.0 | active | — | — | — |
| git 2.45.0 | active | — | — | — |
根因分析
运行 git 的机器系统时钟与工作树中文件的时间戳存在显著差异,导致 git 误判文件修改时间,可能跳过重建或产生过时的输出。
English
The system clock on the machine running git is significantly ahead or behind the timestamps of files in the working tree, causing git to misjudge file modification times and potentially skip rebuilds or produce stale outputs.
官方文档
https://git-scm.com/docs/git#_configuration解决方案
-
sudo ntpdate -s time.nist.gov # Sync system clock with an NTP server to eliminate the skew
-
git add -A && git commit --allow-empty -m 'reset timestamps' # Force a commit to reset internal timestamps, but this is a temporary fix
无效尝试
常见但无效的做法:
-
95% 失败
Running git clean -fd to remove untracked files does not fix the clock skew issue; it only deletes files without addressing the root cause.
-
70% 失败
Manually touching all files with touch * can temporarily mask the issue but the skew will reappear on subsequent operations if clock is not fixed.