git-rebase
Skill4 starsChanged 6 months agoMITView on GitHub
Advanced Git rebase operations including interactive history cleanup and non-interactive scripted rewrites. You MUST load this skill before performing Git rebase operations.
- Deletes or force-pushes
- Commits and pushes
8 other projects use a version of this.
Adopted by
Most recently taken up by
- compozy/compozytheir own version, first seen Nov 7, 2026
- cognis-digital/skillsmiththeir own version, first seen Oct 11, 2026
- zulip/zuliptheir own version, first seen Oct 8, 2026
- kimtth/agent-skill-100-lines-or-lesstheir own version, first seen Jun 26, 2026
- CH3COOH/claude-skillstheir own version, first seen Jun 13, 2026
- FelipeAngeli/skillstheir own version, first seen Apr 10, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- zulip/zulip★ 26ksame name
- compozy/compozy★ 2.9ksame name
- pedronauck/skills★ 649same name
- an8079/take-skills★ 4same name
- CH3COOH/claude-skills★ 2same name
- FelipeAngeli/skills★ 2same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- cognis-digital/skillsmith★ 0same 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 repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-agentSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- direnvSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-aw-troubleshootingSkill
- gh-codespaceSkill
- gh-issueSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
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
When updating a feature branch with the latest changes from main to maintain a linear history.
- Distinctive: line 19
When moving a branch's base from one commit to another to untangle dependency chains.
- Very specific: line 38
Start manual rebase: git rebase -i <base-commit-or-branch>
- Distinctive: line 45
NEVER rebase commits that have already been pushed to a shared public branch unless explicitly coordinating a force-push.
“Common” is measured: kept by at least 6 in 10 of the 6 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
<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->Git Rebase
Expert-level guidance for executing Git rebase operations safely, particularly distinguishing between interactive manual usage and automated environments.
When to Use
- When updating a feature branch with the latest changes from
mainto maintain a linear history. - To squash or fix up messy, intermediate commits before opening a Pull Request (using
git rebase -i --autosquashlocally). - When moving a branch's base from one commit to another to untangle dependency chains.
When Not to Use
- On shared or public branches where other developers have already pulled the commits (doing so rewrites history and causes severe integration headaches).
- For simple feature integrations where a standard merge commit is explicitly requested or preferred by the team's workflow.
- In fully automated CI/CD environments unless strictly using non-interactive scripting to handle specific autosquash patterns.
Common Pitfalls
- Interactive Terminal Hangs: Using
-iin an automated agent environment, causing the system to freeze while waiting for a VIM editor input that will never happen. - Force-Pushing Blindly: Running
git push --forceafter a rebase instead ofgit push --force-with-lease, potentially destroying a teammate's recent commits. - Conflict Panic: Encountering a merge conflict during a rebase and running chaotic commands instead of methodically resolving the files, adding them, and running
git rebase --continue(or--abortif hopelessly stuck).
Interactive Rebasing (git rebase -i)
- Objective: Clean up local commit history before pushing.
- Process:
- WARNING: Interactive modes (
-i) are FORBIDDEN in runtime automation. Ensure-iis strictly scoped to local manual-only usage or fixing in the non-GitHub runtime (like in local agent or devcontainer runtime). - Start manual rebase:
git rebase -i <base-commit-or-branch> - Non-interactive note:
GIT_SEQUENCE_EDITOR=trueonly skips opening the editor; it does not rewrite the rebase todo list. - Scripted rewrites: For automation, set
GIT_SEQUENCE_EDITORto a script or command that edits the todo file, or prefergit rebase -i --autosquashwithfixup!/squash!commits when appropriate. - Actions in the todo list:
pick,reword,edit,squash(ors),fixup(orf),drop.
- WARNING: Interactive modes (
Safety Principles
- NEVER rebase commits that have already been pushed to a shared public branch unless explicitly coordinating a force-push.
- Abort: Execute
git rebase --abortto safely cancel an ongoing rebase operation.
What to Avoid
- Interactive command execution (
git rebase -i) in automated runtime pipelines.
Limitations
- Cannot autonomously perform interactive rebasing in restricted runtime environments.
Related Skills
- git: You MUST load this skill when performing standard Git operations.
- git-expert: You MUST load this skill when performing advanced Git operations beyond rebasing.
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.

