Git Rebase — Git skill for Claude Code
Rebases onto origin/main (or origin/master) and resolves conflicts.
How to install Git Rebase
Installs to ~/.claude/skills/oalders-kitchen-sink-git-rebase/SKILL.md
mkdir -p ~/.claude/skills/oalders-kitchen-sink-git-rebase && curl -fsSL https://raw.githubusercontent.com/oalders/kitchen-sink/HEAD/commands/git-rebase.md -o ~/.claude/skills/oalders-kitchen-sink-git-rebase/SKILL.md Restart Claude Code, or start a new session, for it to be picked up.
What Git Rebase does
description: Rebases onto origin/main (or origin/master) and resolves conflicts
Rebase the current branch onto the remote default branch, resolving any conflicts that arise.
Steps:
- Detect the default branch. Prefer
main; fall back tomasterifmaindoes not exist on the remote:- Run
git ls-remote --heads origin main— if the output is non-empty, usemain - Otherwise run
git ls-remote --heads origin master— if non-empty, usemaster - If neither exists, stop a
- Run
Alternatives in Git
- Ws Reset — Reset the current branch to main, fetch upstream, and update submodules 38.1k ★
- Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
- Git Master 24.1k ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Rebase On Main
Rebase the current branch on origin/main and resolve any conflicts.
Rebase PR
Use when: rebasing a PR branch onto main and the rebase produces conflicts. Triggers on: rebase origin/main, r
Git Sync
Performs a safe git rebase and resolves conflicts systematically.
Rebase Master
Fetch origin/master and rebase the current branch onto it
Safe Pull
安全地從 origin/main 拉取最新內容到本機,自動 stash 本地未 commit 的修改,rebase 完成後再還原
Resolve Conflict
You are resolving git merge/rebase conflicts. Follow this procedure, and briefly tell the user what you're doi
Related Agents
Flow Git
Use this agent for git operations — atomic commits, rebase, history cleanup, and style detection. Flow detects
Remediator
Fix-up agent for an existing PR branch — rebases onto the integration branch, resolves merge conflicts, fixes
Gitnexus Branch Hygiene Reviewer
GitNexus branch hygiene and mergeability reviewer. Use to classify merge state, conflicts, stale branches, mer