git
Git Operations
Advanced git workflows: rebase surgery, conflict resolution, and coexistence in shared multi-agent repos.
PR Branch Upkeep
The most-run workflow: keeping your own PR branch current against a moving main.
Capture the target base and remote branch tip, preserve a backup, rebase when required, and run checks on the resulting content. Recheck remote state before pushing. A base that keeps moving is not a reason for an endless rebase loop: use the captured base and the repository's merge policy. When current-main ancestry is required, check it explicitly:
git merge-base --is-ancestor origin/main HEAD && echo "based on current main"
Review etiquette: while a reviewer (bot, human, or agent) is actively reading, hold pushes. Batch fixes, then one rebase+push when the review lands. Freshness loops run at push boundaries.
Pushing rewritten history
Pin the lease to the remote tip whose work you inspected before rewriting. Background fetches can refresh a tracking ref and weaken an implicit lease. Recheck with ls-remote before pushing; if the tip changed, inspect and reconcile that work instead of copying its SHA into a fresh lease: