Sync your feature branch with the latest changes from origin/main, with intelligent conflict resolution assistance.
Sync your feature branch with the latest changes from origin/main, with intelligent conflict resolution assistance.
/plugin marketplace add kenotron-ms/amplifier-setup/plugin install git@amplifier-setupSync your feature branch with the latest changes from origin/main, with intelligent conflict resolution assistance.
All git commands must run in the actual project directory, not the Claude worktree.
The commands will use PROJECT_DIR environment variable if set, otherwise fall back to the current directory ($PWD).
At the start of this command, set PROJECT_DIR:
# Use PROJECT_DIR if set, otherwise use current directory
PROJECT_DIR="${PROJECT_DIR:-$PWD}"
echo "Working in: $PROJECT_DIR"
Then for all git commands, use:
cd "$PROJECT_DIR"
git <command>
Follow these steps in order:
Run these commands to understand the situation:
cd "$PROJECT_DIR"
git status
git branch --show-current
git stash list
Pre-flight checks:
git stash push -m "Auto-stash before git-pull sync"
cd "$PROJECT_DIR"
git fetch origin main
Show the user what's new:
git log --oneline HEAD..origin/main | head -20
If nothing new, inform user they're already up to date.
Prefer rebase over merge for cleaner history:
cd "$PROJECT_DIR"
git rebase origin/main
If rebase succeeds: Skip to Step 5 (Restore stash)
If conflicts occur: Proceed to Step 4
When conflicts are detected:
List all conflicting files:
cd "$PROJECT_DIR"
git diff --name-only --diff-filter=U
For EACH conflicting file, guide the user through resolution:
a. Show the conflict context:
git diff <filename>
b. Read the file to understand both sides of the conflict
c. Use AskUserQuestion to help the user decide - frame it as a high-level choice:
Present options like:
DO NOT ask users to pick specific lines of code. Instead:
d. Based on user's choice:
git checkout --ours <file> or git checkout --theirs <file>e. After resolving, stage the file:
git add <filename>
After all conflicts resolved:
cd "$PROJECT_DIR"
git rebase --continue
If more conflicts appear, repeat Step 4.
If changes were stashed in Step 1:
cd "$PROJECT_DIR"
git stash pop
If stash pop has conflicts, help resolve those too using the same approach.
Show the user:
High-level thinking over line-by-line diffs:
When explaining conflicts to users, focus on:
NOT:
The goal is to help users understand the SEMANTIC conflict, not the textual one.
At any point during conflict resolution, offer the user:
git rebase --abort)git rebase --skip) - use sparinglygit rebase --abort to start fresh/pullPull latest changes from Azure DevOps (like git pull). Supports increment, project, or full living docs sync.
/pullPull latest changes from Jira (like git pull). Imports status, priority, sprint, and comments.