git runtime_error ai_generated true

warning: clock skew detected. Your build may be incomplete.

ID: git/warning-large-filesystem-time-skew

Also available as: JSON · Markdown · 中文
90%Fix Rate
85%Confidence
1Evidence
2023-09-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
git 2.20.0 active
git 2.38.0 active
git 2.45.0 active

Root Cause

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.

generic

中文

运行 git 的机器系统时钟与工作树中文件的时间戳存在显著差异,导致 git 误判文件修改时间,可能跳过重建或产生过时的输出。

Official Documentation

https://git-scm.com/docs/git#_configuration

Workarounds

  1. 90% success sudo ntpdate -s time.nist.gov # Sync system clock with an NTP server to eliminate the skew
    sudo ntpdate -s time.nist.gov  # Sync system clock with an NTP server to eliminate the skew
  2. 60% success git add -A && git commit --allow-empty -m 'reset timestamps' # Force a commit to reset internal timestamps, but this is a temporary fix
    git add -A && git commit --allow-empty -m 'reset timestamps'  # Force a commit to reset internal timestamps, but this is a temporary fix

中文步骤

  1. sudo ntpdate -s time.nist.gov  # Sync system clock with an NTP server to eliminate the skew
  2. git add -A && git commit --allow-empty -m 'reset timestamps'  # Force a commit to reset internal timestamps, but this is a temporary fix

Dead Ends

Common approaches that don't work:

  1. 95% fail

    Running git clean -fd to remove untracked files does not fix the clock skew issue; it only deletes files without addressing the root cause.

  2. 70% fail

    Manually touching all files with touch * can temporarily mask the issue but the skew will reappear on subsequent operations if clock is not fixed.