| name | pull |
| description | Pull latest origin/main into the current local branch and resolve merge conflicts (aka update-branch). Use when Codex needs to sync a feature branch with origin, perform a merge-based update (not rebase), and guide conflict resolution. |
Pull
Workflow
- Verify git status is clean or commit/stash changes before merging.
- Ensure rerere is enabled locally:
git config rerere.enabled true
git config rerere.autoupdate true
- Confirm remotes and branches:
- Ensure the
origin remote exists.
- Ensure the current branch is the one to receive the merge.
- Fetch latest refs:
git fetch origin
- Sync the remote feature branch first:
git pull --ff-only origin $(git branch --show-current)
- Merge origin/main:
git -c merge.conflictstyle=zdiff3 merge origin/main
- If conflicts appear, resolve them (see guidance below), then:
git add <files>
git commit
- Verify:
mix compile --warnings-as-errors && mix test
- Summarize the merge: call out the most challenging conflicts and how they were resolved.
Conflict Resolution Guidance
- Use
git status to list conflicted files, git diff to see conflict hunks.
- With
merge.conflictstyle=zdiff3, markers are: <<<<<<< ours, ||||||| base, =======, >>>>>>> theirs.
- Summarize intent of both sides before editing. Decide the correct outcome first; write code second.
- Resolve one file at a time; rerun tests after each batch.
- Repo-specific rules apply during conflict resolution — the same AGENTS.md rules govern merged code:
- No
import Bitwise; binary pattern matching for bit fields.
- gen_statem enter callbacks may not transition state.
- After resolving, confirm no conflict markers remain:
git diff --check
When To Ask The User
Only when the correct resolution depends on product intent not inferable from code, tests, or context files. Otherwise, make a best-effort decision, document the rationale, and proceed.