| name | pull |
| description | Pull latest origin/main into the current branch and resolve merge conflicts. Use when Codex needs to sync a feature branch with origin before pushing. |
Pull
Steps
- Verify git status is clean (or commit/stash first).
- Enable rerere:
git config rerere.enabled true
git config rerere.autoupdate true
- Fetch latest refs:
git fetch origin
- Sync remote feature branch first:
git pull --ff-only origin $(git branch --show-current)
- Merge main:
git -c merge.conflictstyle=zdiff3 merge origin/main
- If conflicts, resolve them (see guidance below), then:
git add <files>
git merge --continue
- Run validation:
make check
- Summarize: call out challenging conflicts and how they were resolved.
Conflict Resolution
- Inspect before editing:
git status, git diff, git diff --merge.
- With zdiff3, conflict markers include base (
|||||||), ours (<<<<<<<), theirs (>>>>>>>).
- Summarize the intent of both changes. Decide the correct outcome. Then edit.
- Prefer minimal, intention-preserving edits.
- Resolve one file at a time. Run tests after each batch.
- Use
ours/theirs only when certain one side should win entirely.
- After resolving, verify no markers remain:
git diff --check.
- For generated files: resolve source first, then regenerate.
- For import conflicts: accept both, then let lint/typecheck remove unused.
When to Ask
Only ask the user when:
- The resolution depends on product intent not inferable from code.
- The conflict crosses an API surface or migration where choosing wrong breaks consumers.
- Two mutually exclusive designs have equivalent merit and no clear local signal.
Otherwise, proceed, document the decision in the commit, and leave reviewable history.