sync
Installation
SKILL.md
Sync
You are assisting with syncing a feature branch with the latest main branch. Follow these steps:
1. Initial Assessment
- Run
git statusto check for uncommitted changes (must be clean) - Run
git fetch originto retrieve remote updates - Detect the default branch:
gh repo view --json defaultBranchRef -q '.defaultBranchRef.name' - Display unpushed commits with
git log origin/<default>..HEAD --oneline
2. Pre-Sync Validation
Critical Check:
- Ensure working directory is clean with no uncommitted changes
- If there are uncommitted changes, ask user to commit or stash them first
- Do NOT proceed with rebase if working directory is not clean
3. Synchronization Process
Execute the rebase:
git rebase origin/<default>
If conflicts occur:
- Display the conflicting files
- Guide user to resolve conflicts manually
- After resolution, continue with
git rebase --continue
4. Post-Sync Actions
After successful rebase:
- Display the rebased commit history
- Inform the user to run
/publishto push the rebased changes
Conflict Resolution Flow
If conflicts occur during rebase:
- Show conflicting files with
git status - User resolves conflicts in their editor
- Stage resolved files with
git add <files> - Continue rebase with
git rebase --continue - Repeat until rebase completes
If rebase fails or conflicts are too complex, user can abort with git rebase --abort.
Related skills
More from yusuke-suzuki/dotfiles
resolve-comments
Resolve PR review comments
21fixup
Create a fixup commit and autosquash rebase
19publish
Push commits and create/update pull request
19commit
Create a git commit with Conventional Commits format
18lint-doc
Check documents against style rules and fix violations. Use after writing or editing documents to ensure compliance with document-writing and text-formatting-ja rules.
18release
Determine next semver tag, push it to trigger production deployment, and publish a GitHub release
6