bnadlerjr/dotfiles/using-git-machete
Claude Code and agent skill by bnadlerjr/dotfiles
- community
Checking that the SKILL.md file is still in the repository.
git-machete command-line expertise covering branch tree management, fork-point mechanics, rebase-driven syncing, and stacked-PR workflows on GitHub. Use when building or maintaining a tree of dependent branches, rebasing chains of feature branches against `main`, debugging fork-point inference after force-pushes or squashes, or driving stacked GitHub PRs with `git machete github` subcommands. Also use for `.git/machete` edits, `traverse` flag selection, and `advance`/`slide-out` after merges.
Install
npx vskill@latest install bnadlerjr/dotfiles/using-git-macheteSKILL.md
Using git-machete
Expert guidance for managing branch trees and stacked PRs with git-machete (v3.x).
Quick Start
For immediate help, identify your task type and consult the relevant reference:
| Working On | Reference File | Key Topics | |
|---|---|---|---|
| discover, edit, add, status, traverse, slide-out | core-commands | Branch tree CRUD, traversal flags, status -L | |
| fork-point overrides, advance, squash, reapply | fork-points-and-rebase | Fork-point inference, overrides, annotations | |
| github checkout-prs, create-pr, restack-pr, retarget-pr, anno-prs, update-pr-descriptions | github-integration | Stacked PRs, retarget, anno-prs |
Core Principles
.git/machete Is the Source of Truth
The branch tree lives in .git/machete, an indented text file. Most "machete is wrong" problems are solved by running git machete edit and fixing the indentation by hand.
status -L Is the Default Diagnostic
Always start with git machete status -L (or --list-commits). It shows the tree, sync state of each branch versus its parent, and the commits unique to each branch. Plain status hides the commits and hides why a branch is out of sync.
Let traverse Drive Rebases — Don't Run git rebase Yourself
git machete traverse walks the tree, rebases each branch onto its parent's tip using machete's fork-point inference, and (optionally) pushes. Running git rebase directly on a managed branch bypasses fork-point logic and creates duplicate commits on the next traverse.
Trust Fork-Point Inference Until It's Wrong, Then Override Explicitly
Fork-points are inferred from the reflog. Force-pushes, upstream squash-merges, and rebases off the chain corrupt that inference. Fix with --override-to-inferred or --override-to=<commit> rather than editing history blindly.
After a PR Merges, advance — Don't slide-out
When a child branch's commits land on its parent (typical after a squash-merge or fast-forward merge), git machete advance fast-forwards the parent and slides the child out of the tree in one step. Use slide-out only when the branch was abandoned without merging.
Common Pattern Template
The canonical daily loop for a managed tree:
For starting a new feature on top of an existing branch:
Anti-Patterns
Editing .git/machete to Remove a Merged Branch
Running git rebase on a Managed Branch
Force-Pushing Without --force-with-lease After a Rebase
Trusting Fork-Point After a Squash-Merge Upstream
Reference File IDs
For programmatic access: core-commands · fork-points-and-rebase · github-integration
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclaude/skills/using-git-machete/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bnadlerjr/dotfiles/using-git-machete)