repo-sync
Syncs your branch with main via rebasing. Use this to stay current, resolve conflicts, and keep history clean.
Install
mkdir -p .claude/skills/repo-sync && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18823" && unzip -o skill.zip -d .claude/skills/repo-sync && rm skill.zipInstalls to .claude/skills/repo-sync
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Sync a feature branch with the default branch and resolve conflicts. Use when the branch is stale, a push is rejected, CI needs the latest main, or merging needs a conflict-free branch.Key capabilities
- →Sync a feature branch with the default branch
- →Rebase onto the latest main branch
- →Resolve merge conflicts
- →Preserve the branch's intent and user changes
- →Push the rewritten branch with `git push --force-with-lease`
- →Summarize conflict files, decisions, and validation
How it works
The skill fetches and fast-forwards the current branch, then rebases it onto the main branch. It guides conflict resolution and verifies the branch history before pushing.
Inputs & outputs
When to use repo-sync
- →Sync stale branch with main
- →Resolve merge conflicts
- →Clean up branch history before merge
- →Fetch remote updates
About this skill
Repo Sync
Goals
- Keep the feature branch current with
origin/mainthrough rebasing. - Preserve the branch's intent and the user's changes.
- Resolve conflicts by understanding both sides before editing.
- Rerun the relevant checks after conflict resolution.
- Never introduce a merge commit when synchronizing a feature branch.
Steps
-
Confirm the current branch and working tree with
git status --short --branch. -
If there are uncommitted changes, commit them with the
commitskill or stop and ask how to handle them. -
Enable recorded conflict reuse locally:
git config rerere.enabled true git config rerere.autoupdate true -
Fetch and fast-forward the current branch if the remote branch advanced:
branch="$(git branch --show-current)" git fetch origin git pull --ff-only origin "$branch" -
Rebase onto latest main with conflict context:
git -c merge.conflictstyle=zdiff3 rebase origin/main -
If conflicts occur:
- Use
git status,git diff --merge, and nearby code/tests/docs to understand both sides. - Resolve the intended behavior first, then edit.
- Do not choose
oursortheirsfor a whole file unless that is clearly correct. - Stage each resolution and continue with
GIT_EDITOR=true git rebase --continue. - Run
git diff --checkafter the rebase completes.
- Use
-
Run the relevant checks from
AGENTS.md. -
Verify
git rev-list --merges origin/main..HEADis empty. -
Push the rewritten branch with
git push --force-with-lease, using the previously fetched remote branch as the lease protection. -
Summarize conflict files, decisions, and validation in the branch notes or handoff comment.
Stop Conditions
- The conflict depends on product intent that is not inferable from the repo, issue, or current user instructions.
- The rebase would drop user changes or alter an external contract without clear confirmation.
When not to use it
- →When the conflict depends on product intent not inferable from the repo, issue, or instructions
- →When the rebase would drop user changes or alter an external contract without confirmation
Limitations
- →Never introduce a merge commit when synchronizing a feature branch
- →Does not choose 'ours' or 'theirs' for a whole file unless clearly correct
- →Requires understanding both sides of a conflict before editing
How it compares
This skill provides a structured process for rebasing and resolving conflicts, ensuring a clean branch history and preserving changes, unlike manual rebasing that might lead to merge commits or lost work.
Compared to similar skills
repo-sync side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| repo-sync (this skill) | 0 | 18d | Review | Intermediate |
| github-manage | 6 | 8mo | Review | Beginner |
| tmux | 20 | 2mo | Review | Intermediate |
| jira | 11 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by martin-francois
View all by martin-francois →You might also like
github-manage
matteocervelli
Manage operations concerning GitHub on behalf of user
tmux
openclaw
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
jira
davila7
Use when the user mentions Jira issues (e.g., "PROJ-123"), asks about tickets, wants to create/view/update issues, check sprint status, or manage their Jira workflow. Triggers on keywords like "jira", "issue", "ticket", "sprint", "backlog", or issue key patterns.
github-issues
github
Create, update, and manage GitHub issues using MCP tools. Use this skill when users want to create bug reports, feature requests, or task issues, update existing issues, add labels/assignees/milestones, or manage issue workflows. Triggers on requests like "create an issue", "file a bug", "request a feature", "update issue X", or any GitHub issue management task.
triaging-issues
pytorch
Triages GitHub issues by routing to oncall teams, applying labels, and closing questions. Use when processing new PyTorch issues or when asked to triage an issue.
file-manager
Xxiii8322766509
文件管理技能。用于创建、移动、复制、删除文件和文件夹,整理目录结构。当用户需要管理文件、整理文件夹或批量处理文件时使用。