Pcornel
Automation · Git

Push

Cheat sheet · https://pcornel.dk/topic.php?topic=5475

Back to the Topic

Answer

Git push requests that a remote repository update selected refs from local objects, subject to refspecs, permissions and remote policy.

Remember

  • Push accepted ≠ downstream deployment succeeded; remote ref update is only the version-control boundary.
  • Objects uploaded ≠ destination ref updated; server policy may reject the ref change.
  • Force push ≠ normal synchronization; it can replace remote ancestry and invalidate collaborators state.
  • Local branch ahead ≠ safe to push; protected branch policy or stale remote state can still block/update risk.

First checks

  • git push -u origin <branch> — push branch
  • git push --force-with-lease — safe force (own branches)
  • Branch protection rejects direct pushes to main — policy

Verify in this order

local commits → push → remote

Where it usually breaks

A successful push proves the remote accepted the requested Git ref update at that moment; it does not prove triggered automation completed or the target converged.

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Push Git boundary map

BoundaryHealthy evidenceSuspicious evidence
Local stateRepository, HEAD, worktree/index and commit IDs are explicitWrong repo/ref, hidden staged/untracked state or mutable-name ambiguity
History / refsAncestry and branch/tag movement match intentUnexpected rewrite, stale tracking ref or unclear merge base
Remote syncURL/refspec, auth and remote read-back match expected commitsLocal assumptions, rejection, stale fetch or unsafe force update
Downstream proofBuild/reconciliation/target is verified independentlyPush/tag/merge success treated as deployment success

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5475

Confirmation

Confirm action

Continue?