Appearance
date: 2026-06-09 tags: [git, ephemeral-container, web-env, footgun] status: active graduated_to:
The ephemeral container can resync your local copy behind origin — a new commit then lands on a stale base
Symptom — after a gap (background agents running, container idle), git push was rejected non-fast-forward; git log HEAD..origin showed origin had commits the local HEAD lacked, and a just-made commit had branched off an older tip.
Root cause — the remote/web container is ephemeral and can resync the working copy to an earlier commit between turns; committing then builds on a stale base, diverging from origin (which still holds the already-pushed work).
Fix — before committing after any gap: git fetch origin <branch> then git reset --hard origin/<branch> (or --ff-only merge a subagent's branch) so new work sits on the real tip. This session reconciled a stranded commit via git reset --soft origin/<branch> + recommit.
Guard — habit: fetch + verify HEAD == origin/<branch> before committing in the remote env. Inverse of 2026-06-07-find-lost-work-by-content-not-branch-name (that one finds lost work; this one avoids committing onto stale state).