← ClaudeAtlas

updatelisted

Use when a branch or PR has merge conflicts, is behind main, or needs upstream changes pulled in. Triggers on "resolve the merge conflicts", "there's a merge conflict on the PR, fix it", "rebase this PR on main", "catch this branch up with main", "update my branch". Fetches, merges the base branch (merge, not rebase), and resolves conflicts by reading the intent of both sides. Do NOT use for fast-forwarding a local main after a merge (just git pull).
technicalpickles/pickled-claude-plugins · ★ 10 · AI & Automation · score 72
Install: claude install-skill technicalpickles/pickled-claude-plugins
# Git Update ## Overview Update your current branch with changes from the upstream branch, intelligently resolving conflicts when they occur. **Announce:** "Using git:update to sync your branch with upstream..." **Philosophy:** - Merge (not rebase) to preserve history - Understand intent behind conflicting changes - Resolve autonomously, present for approval before committing ## When to Use - User says "update", "sync", "pull in latest", "merge main" - PR has conflicts that need resolving - Branch is behind upstream and needs updating - User wants to incorporate recent changes from main/master ## Workflow: Detect Upstream ### Step 1: Try tracking branch ```bash git rev-parse --abbrev-ref @{upstream} 2>/dev/null ``` If this succeeds, use the result (e.g., `origin/main`). ### Step 2: Fall back to PR base branch If no tracking branch: ```bash gh pr view --json baseRefName -q '.baseRefName' 2>/dev/null ``` If this succeeds, use `origin/{result}`. ### Step 3: Ask user if neither works If both fail, use AskUserQuestion: ``` I couldn't detect an upstream branch for this branch. Which branch should I merge from? (A) main (B) master (C) Other - I'll specify ``` ## Workflow: Fetch and Merge ### Step 1: Fetch latest ```bash git fetch origin ``` ### Step 2: Check if update needed ```bash git rev-list --count HEAD..{upstream} ``` If count is 0, report "Already up to date with {upstream}" and stop. ### Step 3: Attempt merge ```bash git merge {upstream} --no-edit `