rebase
Skill115 starsChanged 5 days agoApache-2.0View on GitHub
Rebase the current branch onto the latest main and resolve conflicts
- Deletes or force-pushes
- Commits and pushes
28 other projects use a version of this.
Adopted by
Most recently taken up by
- mjeffrey18/skillstheir own version, first seen Nov 15, 2026
- MarcusJellinghaus/mcp-workspacetheir own version, first seen Nov 14, 2026
- TDesktop-x64/tdesktoptheir own version, first seen Nov 9, 2026
- mustafarslan/skillstheir own version, first seen Nov 8, 2026
- korya/swd-skillstheir own version, first seen Nov 1, 2026
- tkadauke/syrustheir own version, first seen Nov 1, 2026
Used with
Projects with it also use dependency-watch, perform-task and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
telegramdesktopSkilldependency-watch
Audit Telegram Desktop dependencies on freshly fetched origin/dev for releases and security fixes, including upstream lag and backport candidates in patched forks. Use for the scheduled dependency monitor or an explicitly requested dependency report.
Also in 5 projects that use this
telegramdesktopSkillperform-task
Resolve, start or resume, implement, review, test, and publish exactly one existing ai-tdesktop task by short slug or full dated id, including rare blocked retries and split-required results. Use when the user invokes $perform-task or /perform-task with a known task name, or when the continue scheduler delegates one selected task. Runs standard review lenses with fast applicability bailouts and selects task-specific domain and evidence instruments without selecting additional work.
Also in 5 projects that use this
JerovinoSkillprocess-inbox
Processes tasks.md inbox items by triaging each one to its proper location in the vault
Also in 5 projects that use this
Trejon-888Skillcontinue
Load project context, alignment audit, status check, suggest next action. Auto-invoke at session start, after context switches, or when user says 'continue', 'pick up where we left off', 'resume', 'what's next', 'status check', 'what now'.
Also in 6 projects that use this
lepinkainenSkillcode-health
Analyze codebase health - large files, test coverage gaps, duplicate code, dead/legacy code, and documentation issues. Use when asked to scan, audit, or assess code quality, find refactoring targets, or identify technical debt.
Also in 3 projects that use this
dekozaSkillfix-pr
Repair an existing pull request's review findings and target-branch conflicts, verify the result, and update the same open PR.
Also in 3 projects that use this
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 28
- telegramdesktop/tdesktop★ 34ksame name
- raine/workmux★ 3ksame name
- TDesktop-x64/tdesktop★ 3ksame name
- openmeterio/openmeter★ 2.5ksame name
- kukuruzka165/materialgram★ 1.2ksame name
- deadlock-mod-manager/deadlock-mod-manager★ 584same name
- opsmill/infrahub★ 548same name
- burhancodes/fagramdesktop★ 205same name
- fagramdesktop/fadesktop★ 205same name
- tbhb/vale-ai-tells★ 118same name
18 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 6 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 28 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Never git rebase --abort or drop the user's commits without asking.
- Distinctive: line 19
Stop and report if: not a git repo, detached HEAD, or the current branch *is* the base branch.
- Very specific: line 30
If git merge-base --is-ancestor <remote>/<branch> HEAD succeeds, it's already up to date: skip to step 5.
- Distinctive: line 48
Delete/modify conflicts: decide from the intent, then git rm or git add.
- Distinctive: line 49
If the intent is ambiguous or the two sides are incompatible, stop and ask the user, leaving the rebase in progress.
- Very specific: line 50
Make sure no markers are left: git diff --check and grep -nE '^(<<<<<<<|>>>>>>>)( |$)' <files>.
- Distinctive: line 52
If git says the commit is now empty (upstream already has the change), run git rebase --skip and mention it in the report.
- Distinctive: line 63
If signing fails, git reset --soft ORIG_HEAD restores the rebased commits.
- Very specific: line 68
Every rebased commit is signed and signed off.
- Very specific: line 73
If you resolved conflicts, run the project's quick build/lint/tests for the touched code (from the Makefile, package scripts, or CLAUDE.md).
- Very specific: line 80
If the branch has an upstream: git push --force-with-lease origin HEAD:<current-branch>
- Very specific: line 81
If it has none yet: git push --force-with-lease -u origin HEAD:<current-branch>
- Very specific: line 83
If the lease is rejected (someone else pushed to the branch), stop.
“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rebase onto latest main
Arguments from the user (may be empty): $ARGUMENTS
- A branch name overrides the base branch.
--no-push(or any wording like "don't push", "no push", "local only") disables the push in step 7.
Never git rebase --abort or drop the user's commits without asking.
1. Preflight
git status— if a rebase is already in progress, do the single-commit check from step 2, then skip to step 4 (resolve conflicts).- Stop and report if: not a git repo, detached HEAD, or the current branch is the base branch.
- Working tree dirty? Ask the user: stash (
git stash push -u, thengit stash popat the end) or stop.
2. Pick and fetch the base
- Remote:
upstreamif it exists (fork workflow), elseorigin. - Branch: the branch named in the arguments if given, else the remote's default branch with the remote prefix stripped
(
ref=$(git symbolic-ref --short refs/remotes/<remote>/HEAD) && echo "${ref#<remote>/}", since--shortreturns<remote>/main), falling back tomain, thenmaster. git fetch <remote> <branch>— always rebase onto<remote>/<branch>, never a stale localmain.- Note the old HEAD SHA (
git rev-parse HEAD) for the report, and showgit log --oneline <remote>/<branch>..HEAD. - Single-commit PR? Before rebasing, count the PR's commits:
git rev-list --count <remote>/<branch>..origin/<current-branch>(the branch as last pushed, i.e. what the PR shows; don't fetch it, since that would defeat the lease in step 7). If it was never pushed, count<remote>/<branch>..<current-branch>instead. If the count is 1, step 5 squashes the branch back into one commit. - If
git merge-base --is-ancestor <remote>/<branch> HEADsucceeds, it's already up to date: skip to step 5.
3. Rebase
git rebase --signoff -S <remote>/<branch>(--signoff, not -s: for rebase -s means --strategy.) If signing fails, stop and report the error. Don't retry unsigned.
4. Resolve conflicts (repeat until the rebase finishes)
While a rebase is running, "ours" = the base (upstream + already-replayed commits) and "theirs" = the user's commit being replayed.
git diff --name-only --diff-filter=Uto list conflicted files;git show REBASE_HEADto see what the user's commit intended.- Find out why upstream changed the same code:
git log --oneline -p ORIG_HEAD..<remote>/<branch> -- <file>. - Edit each file so that both intents survive (e.g., upstream added a parameter and the commit changed the format → keep the parameter and the new format). Don't just pick a side.
- Lockfiles/generated files: take the base version, then regenerate them with the project's tool if the commit changed dependencies.
- Delete/modify conflicts: decide from the intent, then
git rmorgit add. - If the intent is ambiguous or the two sides are incompatible, stop and ask the user, leaving the rebase in progress.
- Make sure no markers are left:
git diff --checkandgrep -nE '^(<<<<<<<|>>>>>>>)( |$)' <files>. git add <files>thengit rebase --continue(the Claude Code shell already setsGIT_EDITOR=true).- If git says the commit is now empty (upstream already has the change), run
git rebase --skipand mention it in the report.
5. Squash single-commit PRs back to one commit
Skip this unless step 2 counted a single-commit PR and git rev-list --count <remote>/<branch>..HEAD is now more than 1. Then fold everything into one commit that keeps the first commit's message and author (run it as one shell call so $first survives):
first=$(git rev-list --reverse <remote>/<branch>..HEAD | head -n1)
git reset --soft <remote>/<branch> && git commit -s -S -C "$first"If signing fails, git reset --soft ORIG_HEAD restores the rebased commits; then stop and report the error.
6. Verify
git statusis clean with no rebase in progress;git log --oneline <remote>/<branch>..HEADshows the user's commits.- Every rebased commit is signed and signed off. Check signatures through the raw header, since
%G?reportsNfor SSH signatures without an allowedSignersFile:for c in $(git rev-list <remote>/<branch>..HEAD); do git cat-file -p "$c" | grep -q '^gpgsig' || echo "UNSIGNED $c"; done git log --format='%h %(trailers:key=Signed-off-by,valueonly,separator=%x2C )' <remote>/<branch>..HEAD - If you resolved conflicts, run the project's quick build/lint/tests for the touched code (from the Makefile, package scripts, or CLAUDE.md). Ask before starting anything slow.
7. Push (default) and report
Push by default unless the arguments disabled it. Only push when the rebase finished and every step 6 check passed. If anything failed or is still unresolved, don't push and say why.
- Push to the fork
origin, neverupstream. Always name the remote and destination: a baregit pushfollows the branch's configured upstream, which can beupstream/<branch>(e.g. a stack branch from/release).- If the branch has an upstream:
git push --force-with-lease origin HEAD:<current-branch> - If it has none yet:
git push --force-with-lease -u origin HEAD:<current-branch>
- If the branch has an upstream:
- Skip the push when nothing changed (step 2 found it already up to date and the remote branch matches
HEAD). - If the lease is rejected (someone else pushed to the branch), stop. Don't fall back to
--force. Rungit fetch origin <current-branch>, showgit log --oneline HEAD..origin/<current-branch>, and ask the user.
Report briefly: base used, commits replayed, each conflict and how you resolved it, skipped commits, the squash (subjects of the folded-in commits), verification results, push result, and the old HEAD SHA (undo: git reset --hard <sha>).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

