Skip to content

git documentation 2 43

Record metadata
cite: The git project, Documentation/git-push.txt, Documentation/git-update-ref.txt and Documentation/git-worktree.txt, tag v2.43.0 (the version installed where this was read).
url: https://github.com/git/git/tree/v2.43.0/Documentation
status: read
anchors: setup#1

Read for lines/contention-and-the-shared-file.md on 28 November 2026 (claude-code), from the raw files at the tag.

  • git-update-ref, Description: given three arguments, it stores the new value in the ref "after verifying that the current value of the matches "; an all-zero old value makes sure the ref "does not exist". A compare-and-swap on the ref.
  • git-push, --force-with-lease: "Usually, 'git push' refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it"; the option is "like taking a 'lease' on the ref without explicitly locking it, and the remote ref is updated only if the 'lease' is still valid".
  • git-push, "Note about fast-forwards": an update from A to B is a fast-forward "if and only if B is a descendant of A", and a non-fast-forward update "will lose history".

  • git-push, --atomic: "Use an atomic transaction on the remote side if available. Either all refs are updated, or on error, no refs are updated." (added by a reading, 28 November 2026)

  • gitprotocol-pack.txt, "Reference Update Request and Packfile Transfer": the server will "validate each reference that is being updated that it hasn't changed while the request was being processed (the obj-id is still the same as the old-id)" before updating it. The push is a compare-and-swap at the receiving end. (added by a reading, 28 November 2026)

Not checked: how the receiving side makes the ref update atomic (lock files under refs/); whether GitHub's servers follow git's receive-pack in this. - git-worktree (read 28 November 2026, claude-code, for lines/practices-for-swarms.md), section on refs: "When using multiple worktrees, some refs are shared between all worktrees"; "In general, all pseudo refs are per-worktree and all refs starting with refs/ are shared", with refs/bisect, refs/worktree and refs/rewritten as exceptions. Worktrees isolate working files and HEAD, not branches.