Merge the latest default branch (e.g. origin/main) into the current branch, resolve merge conflicts, and verify with pnpm lint && pnpm test. Merge-based sync (not rebase) unless the repo specifies otherwise. Use when syncing a feature branch with origin, after a non-fast-forward push, or when the branch is behind. Does not push or manage PRs—use push and create-pr-jp for those.
origin/main) using a merge (not rebase, unless AGENTS.md or team policy says otherwise).pnpm lint && pnpm test (or the repo’s documented checks).origin exists and points at the expected host.main; use the repo’s default if different).origin/main (or the team base branch).git push is rejected with non-fast-forward, or when the local branch is the remote tracking branch.origin.git config rerere.enabled truegit config rerere.autoupdate trueorigin exists; the current branch is the one that should receive the merge.git fetch origingit pull --ff-only origin "$(git branch --show-current)"main if the repo uses another default):
git -c merge.conflictstyle=zdiff3 merge origin/main for clearer conflict context.git add <files>git commit or git merge --continue as appropriate.pnpm lint && pnpm test, or follow AGENTS.md / project scripts if they differ.pnpm lint && pnpm test (or repo equivalent) passed.Reference flow (adapt main / branch names to the repo):
git config rerere.enabled true
git config rerere.autoupdate true
git fetch origin
# Optional: sync remote feature branch commits first
git pull --ff-only origin "$(git branch --show-current)"
# Merge default branch (zdiff3 for conflict readability)
git -c merge.conflictstyle=zdiff3 merge origin/main
# After resolving conflicts:
# git add … && git commit # or git merge --continue
pnpm lint && pnpm test
git status for conflicted files; git diff / git diff --merge for hunks.git diff :1:path :2:path and :1: vs :3: for base vs ours/theirs.merge.conflictstyle=zdiff3, markers are <<<<<<< ours, ||||||| base, =======, >>>>>>> theirs.pnpm lint && pnpm test after a logical batch of files when helpful.git diff --check (no conflict markers left).Ask only when there is no safe default. Prefer a documented decision and proceed otherwise.
Ask when:
Otherwise complete the merge, note assumptions briefly, and leave reviewable history.
origin/main) and the current branch name.pnpm lint && pnpm test (or what ran) and pass/fail.git pull --ff-only origin <branch> fails, diagnose (diverged history) before merging origin/main.| Situation | Action |
|---|---|
| Dirty working tree | Commit or stash before merge |
merge conflicts | Follow Conflict Resolution, then pnpm lint && pnpm test |
| Wrong default branch name | Use git symbolic-ref refs/remotes/origin/HEAD or repo docs for main vs master |
| Lint/test fails after merge | Fix or revert; do not push broken state—coordinate with push only after green checks |