rebase-main
Skill0 starsChanged 3 months agoMITView on GitHub
Fetch and rebase the current branch onto origin/main (or origin/master) for a clean linear history. Handles conflicts and reports what was done.
- Deletes or force-pushes
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- hyodotdev/openiaptheir own version, first seen Oct 9, 2026
- hyochan/react-native-nitro-soundtheir own version, first seen Oct 8, 2026
- kaiitunnz/claude-skillstheir own version, first seen Sep 8, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- hyochan/react-native-nitro-sound★ 961same name
- hyodotdev/openiap★ 166same name
- kaiitunnz/claude-skills★ 1same name
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.
In this repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- buildSkill
- cleanup-worktreeSkill
- db-querySkill
- db-searchSkill
- dd-errorsSkill
- devops-wiki-updateSkill
- devops-workitem-createSkill
- devops-workitem-readSkill
- devops-workitem-updateSkill
- finalize-taskSkill
- find-codeSkill
- merge-mainSkill
- panel-review-fixSkill
- panel-reviewSkill
- prSkill
- starttaskSkill
- testSkill
- ask-codexSkill
- ask-geminiSkill
- councilSkill
- dailySkill
- find-sessionSkill
- merged-prsSkill
- mm-notifySkill
- optimize-promptSkill
- qSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 14 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 17
Run git rev-parse --abbrev-ref HEAD to get the current branch name.
- Distinctive: line 18
Safety check: if on main or master, stop and warn the user.
- Distinctive: line 19
Run git status --porcelain to check for uncommitted changes.
- Distinctive: line 20
If there are uncommitted changes, stop and warn the user.
- Distinctive: line 24
Run git fetch origin to get the latest remote state.
- Very specific: line 25
Run git rev-list --count HEAD..{main-branch} to see how many new commits are on main.
- Distinctive: line 26
If 0 commits incoming, report "Already up to date with {main-branch}" and stop.
- Distinctive: line 32
If the rebase stops due to conflicts:
- Very specific: line 33
Run git diff --name-only --diff-filter=U to list conflicted files.
- Distinctive: line 39
Both sides changed: Use your best judgment based on the code context.
- Distinctive: line 42
After all conflicts in the current step are resolved, run git rebase --continue.
- Distinctive: line 44
If more than 3 conflict rounds occur, abort the rebase (git rebase --abort) and report to the user that manual resolution is needed.
- Distinctive: line 72
If there are uncommitted changes, do not proceed — ask the user first
- Distinctive: line 73
If a conflict resolution is ambiguous, abort the rebase rather than guessing wrong
- Very specific: line 74
Always use git rebase --continue (never --skip) after resolving conflicts
- Very specific: line 75
Use --force-with-lease (not --force) in the push reminder — it's safer
- Distinctive: line 76
After completion, do NOT push — leave that to the user, but remind them about force-push if needed
- Distinctive: line 77
If anything goes wrong mid-rebase, run git rebase --abort to return to the original state
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rebase Current Branch onto Main
Rebase the current working branch onto the latest origin/main (or origin/master) for a clean, linear commit history. Handle conflicts and produce a summary report.
Your Task
Execute the following steps in order:
1. Pre-flight checks
- Run
git rev-parse --abbrev-ref HEADto get the current branch name. - Safety check: if on
mainormaster, stop and warn the user. Do NOT rebase the main branch. - Run
git status --porcelainto check for uncommitted changes.- If there are uncommitted changes, stop and warn the user. Ask if they want to stash or commit first. Do NOT proceed with a dirty working tree.
- Determine the main branch: check if
origin/mainexists (git rev-parse --verify origin/main). If not, fall back toorigin/master.
2. Fetch and rebase
- Run
git fetch originto get the latest remote state. - Run
git rev-list --count HEAD..{main-branch}to see how many new commits are on main.- If 0 commits incoming, report "Already up to date with {main-branch}" and stop.
- Capture the incoming commit list BEFORE rebasing:
git log --oneline HEAD..{main-branch}. - Run
git rebase {main-branch}. - Capture the rebase output.
3. Handle conflicts
If the rebase stops due to conflicts:
- Run
git diff --name-only --diff-filter=Uto list conflicted files. - For each conflicted file:
a. Read the file to see the conflict markers (
<<<<<<<,=======,>>>>>>>). b. Analyze the conflict:- Theirs-only changes (our side is unchanged around the conflict): accept theirs.
- Ours-only changes (their side is unchanged around the conflict): accept ours.
- Both sides changed: Use your best judgment based on the code context. Prefer combining both changes when they don't overlap logically. If the conflict is complex or ambiguous, abort the rebase (
git rebase --abort), report the issue, and let the user handle it manually. c. Edit the file to remove conflict markers and apply the resolution. d. Rungit add {file}to mark it resolved.
- After all conflicts in the current step are resolved, run
git rebase --continue. - Repeat steps 1-3 if the rebase stops again on subsequent commits.
- If more than 3 conflict rounds occur, abort the rebase (
git rebase --abort) and report to the user that manual resolution is needed.
4. Post-rebase report
Generate a clear report with:
## Rebase Report: {current-branch} onto {main-branch}
### Summary
- **New commits from main:** {count}
- **Conflicts:** {count} ({list of files, or "None"})
- **Status:** {Rebased cleanly | Rebased with conflict resolution | Aborted}
### Commits from main
{list of commits from git log --oneline captured BEFORE the rebase}
### Conflict Resolutions (if any)
For each resolved conflict:
- **{filename}**: {brief description of what conflicted and how it was resolved}
### Notes
- Your local commits have been replayed on top of the latest main.
- If your branch was previously pushed, you will need to force-push: `git push --force-with-lease`Important
- Never rebase
mainormaster— check the branch name first - If there are uncommitted changes, do not proceed — ask the user first
- If a conflict resolution is ambiguous, abort the rebase rather than guessing wrong
- Always use
git rebase --continue(never--skip) after resolving conflicts - Use
--force-with-lease(not--force) in the push reminder — it's safer - After completion, do NOT push — leave that to the user, but remind them about force-push if needed
- If anything goes wrong mid-rebase, run
git rebase --abortto return to the original state
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.

