`git log` shows commits out of order and with dates in the future.
IntermediateTroubleshootingLost Work, HEAD and History Problems
Answer
Likely causes → Wrong system clock or timezone on a dev machine or CI runner, imported history with odd dates, or rebases that preserve author dates while committer dates differ.
Diagnose →
git log --format='%h %ad | %cd | %s' --date=iso -10
date -u
Fix → Fix the clock (NTP). To correct commit dates before pushing: git rebase --committer-date-is-author-date or git rebase -i --exec 'git commit --amend --no-edit --date=now'. For tooling, sort by topology (--topo-order).
Prevent → Keep NTP enabled on laptops and CI runners.
More on Lost Work, HEAD and History Problems
`fatal: Unable to create '/repo/.git/index.lock': File exists.`BeginnerYou added a file to `.gitignore`, but `git status` still shows it as modified.Beginner`fatal: your current branch 'main' does not have any commits yet`Beginner`Author identity unknown *** Please tell me who you are.` and `fatal: unable to auto-detect email address`Beginner`fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.`BeginnerYour commits do not show on your GitHub profile contribution graph.Intermediate