<CONTEXT>
Pulls a branch from remote with intelligent conflict handling. Use when you need to sync local branches with remote changes, with options for rebase, merge strategies, and safe branch switching.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractary<CRITICAL_RULES> YOU MUST:
YOU MUST NOT:
COMMAND ISOLATION:
WHEN COMMANDS FAIL:
THIS COMMAND IS ONLY A ROUTER. </CRITICAL_RULES>
<WORKFLOW> 1. **Parse user input** - Extract branch name and options - Parse optional flags (remote, rebase, strategy) - Validate argumentsBuild structured request
Invoke agent
Return response
<ARGUMENT_SYNTAX>
This command follows the space-separated argument syntax (consistent with work/repo plugin family):
--flag value (NOT --flag=value)--remote origin ✅--remote=origin ❌Branch names with spaces (rare but possible):
✅ /repo:pull "feature/some branch name"
❌ /repo:pull feature/some branch name
Single-word values don't require quotes:
✅ /repo:pull feature/123-add-export
✅ /repo:pull main --remote upstream
✅ /repo:pull --rebase
Boolean flags have no value:
✅ /repo:pull --rebase
✅ /repo:pull feature/branch --rebase
❌ /repo:pull --rebase true
❌ /repo:pull --rebase=true
Strategy values:
✅ /repo:pull --strategy auto-merge-prefer-remote
✅ /repo:pull --strategy rebase
✅ /repo:pull main --strategy manual
❌ /repo:pull --strategy=rebase
</ARGUMENT_SYNTAX>
<ARGUMENT_PARSING>
Purpose: Pull branch from remote repository with intelligent merge conflict handling
Optional Arguments:
branch_name (string): Branch name to pull (default: current branch). Example: "feature/123-add-export"--remote (string): Remote repository name (default: origin). Examples: "origin", "upstream", "fork"--rebase (boolean flag): Use rebase instead of merge. No value needed, just include the flag. PRECEDENCE: Overrides --strategy flag--strategy (string): Conflict resolution strategy. Options:
auto-merge-prefer-remote - Automatically merge, preferring remote changes in conflicts (DEFAULT)auto-merge-prefer-local - Automatically merge, preferring local changes in conflictsrebase - Rebase local commits onto remote branchmanual - Fetch and merge without auto-resolution (user handles conflicts)fail - Fail if conflicts would occur (safe mode)--allow-switch (boolean flag): Allow switching branches with uncommitted changes. No value needed, just include the flag. SECURITY: By default, pull fails if switching branches with uncommitted changesMaps to: pull-branch
Example:
/repo:pull feature/123-add-csv-export
→ Invoke agent with {"operation": "pull-branch", "parameters": {"branch_name": "feature/123-add-csv-export"}}
Strategy Examples:
/repo:pull --strategy auto-merge-prefer-remote
→ Uses default strategy (remote changes win in conflicts)
/repo:pull --strategy auto-merge-prefer-local
→ Local changes win in conflicts
/repo:pull --rebase
→ Rebase local commits onto remote
/repo:pull --strategy manual
→ Fetch and merge, but don't auto-resolve conflicts
</ARGUMENT_PARSING>
<EXAMPLES> ## Usage Examples# Pull current branch
/repo:pull
# Pull specific branch
/repo:pull feature/123-add-csv-export
# Pull with rebase
/repo:pull feature/123-add-csv-export --rebase
# Pull from specific remote
/repo:pull main --remote upstream
# Pull with specific merge strategy (prefer remote)
/repo:pull --strategy auto-merge-prefer-remote
# Pull with specific merge strategy (prefer local)
/repo:pull --strategy auto-merge-prefer-local
# Pull in safe mode (fail on conflicts)
/repo:pull --strategy fail
# Pull different branch while allowing uncommitted changes to carry over
# (By default, this would fail with uncommitted changes)
/repo:pull feature/456-other-branch --allow-switch
# Combine flags: pull with rebase and allow switch
/repo:pull feature/789-refactor --rebase --allow-switch
</EXAMPLES>
<AGENT_INVOCATION>
After parsing arguments, invoke the repo-manager agent using the Task tool.
Agent: fractary-repo:repo-manager
How to invoke: Use the Task tool with the agent as subagent_type:
Task tool invocation:
- subagent_type: "fractary-repo:repo-manager"
- description: Brief description of operation
- prompt: JSON request containing operation and parameters
Example invocation:
Task(
subagent_type="fractary-repo:repo-manager",
description="Pull branch from remote",
prompt='{
"operation": "pull-branch",
"parameters": {
"branch_name": "feature/123-add-export",
"remote": "origin",
"strategy": "auto-merge-prefer-remote"
}
}'
)
CRITICAL - DO NOT:
The agent will:
Request structure:
{
"operation": "pull-branch",
"parameters": {
"branch_name": "branch-name",
"remote": "origin",
"rebase": true|false,
"strategy": "auto-merge-prefer-remote|auto-merge-prefer-local|rebase|manual|fail",
"allow_switch": true|false
}
}
Important Notes:
rebase: true is provided, it overrides the strategy parameter (--rebase takes precedence)allow_switch defaults to false for security - must be explicitly set to true to switch branches with uncommitted changespull-branch - Pull branch from remote with intelligent conflict handling
</AGENT_INVOCATION><ERROR_HANDLING> Common errors to handle:
Branch not found:
Error: Branch not found: feature/nonexistent
Check branch name: git branch -a
Remote not configured:
Error: Remote not found: upstream
Check remotes: git remote -v
Merge conflicts:
Error: Merge conflicts detected in 3 files
Strategy 'fail' prevents automatic resolution
Resolve manually or use different strategy
No upstream branch:
Error: No upstream branch configured for: feature/123
Set upstream first: git branch --set-upstream-to=origin/feature/123
</ERROR_HANDLING>
<NOTES> ## RequirementsGit Version:
Bash Version:
⚠️ Branch Switching with Uncommitted Changes: The pull command switches to the target branch if you're not already on it.
git stash # Stash changes
/repo:pull feature/other-branch # Pull works without --allow-switch
git stash pop # Restore changes
# OR explicitly allow switch
/repo:pull feature/other-branch --allow-switch
⚠️ Uncommitted Changes:
The pull command includes intelligent merge strategies:
This command works with:
Platform is configured via /repo:init and stored in .fractary/plugins/repo/config.json.
Related commands:
/repo:push - Push branches to remote/repo:branch - Manage branches/repo:commit - Create commits/repo:init - Configure repo plugin
</NOTES>
/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.