What it does
Probably the sharpest git repository organizer & rebase/merge workflow automation tool you've ever seen
- Connects Instruction files the AI reads
- Account or key Not confirmed yet (README not read yet)
- Category Coding
For makers: add a badge to your README
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/skills/virtuslab-git-machete)Use together with
MCP servers that connect the AI to services for the same work
Fallow
Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.
Desktop Commander
MCP server for terminal commands, file operations, and process management
Similar Skills
Same kind of work, ordered like the Skills list
| This one git-machete | rea | andrej-karpathy-skills | graphify | MoneyPrinterTurbo | |
|---|---|---|---|---|---|
| Maker | VirtusLab | morluto | multica-ai | Graphify-Labs | harry0703 |
| Skills | 1 | 1 | 1 | 1 | 1 |
| GitHub stars | 1,149 | 463,670 | 233,682 | 148,887 | 143,987 |
| Last code change | Nov 16, 2026 | Nov 17, 2026 | Apr 20, 2026 | Nov 17, 2026 | Nov 16, 2026 |
| License | MIT | MIT | – | Apache-2.0 | MIT |
1 skills (instruction sets) by VirtusLab that an AI reads and follows · not an MCP server
How a Skill differs from MCP
MCP = the hands
Connects the AI to an outside service or data, such as reading Notion or creating an invoice. A program or server has to be running.
Skill = the manual
A text file that teaches the AI how to do a task. It connects to nothing.
Some overlap: a few Skills run scripts that call tools, and a few MCP servers only send knowledge. Start from the task you want done.
Works with
Claude CodeCodexCursorGitHub Copilot
From the maker’s README and the folders in the repo
Install
Is it safe?
- Who made it
GitHub account VirtusLab (organization), 13 years old
- Use and upkeep
★ 1,149 stars · code last changed Nov 16, 2026
- Any scripts?
No, plain text files the AI reads and follows
- Uses the internet?
No scripts, so it does not go online by itself
- Changes machine-wide settings?
No hooks or writes to machine settings found
Checked automatically from the repo files at commit 0d16f1b (read only, nothing was run). Not a safety guarantee: read it and decide for yourself
First: which AI do you use?
Pick your app and this page shows only how to install it there
Option 1Upload to claude.ai (web and app)
Uploading to claude.ai would fail: the description is over 200 characters (641). Use "Let the AI install it" instead
Option 1Let Claude Code install it
Copy this sentence and paste it into a Claude Code chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Restart Claude Code, then type /git-machete or ask for a matching task and Claude picks it up
Checked against official docs Nov 12, 2026 · Source: code.claude.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.claude/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
Restart Claude Code, then type /git-machete or ask for a matching task and Claude picks it up
ChatGPT desktop app
The ChatGPT desktop app has Codex built in, and Codex reads skills from ~/.agents/skills
Option 1Let ChatGPT install it
Open Codex in the ChatGPT desktop app and paste this sentence into the chat
The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Option 2Put the folder there yourself
Put the git-machete folder at ~/.agents/skills/git-machete
~ is your home folder ($HOME)
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
After installing
- ChatGPT desktop app: open Skills in the sidebar to see that the skill is there
- To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
- Codex picks up newly installed skills by itself; if one does not show up, restart Codex
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
ChatGPT on the web and mobile
Skills you install yourself do not work here; only skills that come with a plugin from the directory
To use this skill with ChatGPT, use the ChatGPT desktop app as above
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
Option 1Let Codex install it
Copy this sentence and paste it into a Codex chat · Works in Codex inside the ChatGPT desktop app, Codex CLI and the IDE extension
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Codex picks up newly installed skills by itself; if one does not show up, restart Codex · To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
Restart Codex, then ask for a matching task; Codex lists the skill
Option 1Let Cursor install it
Copy this sentence and paste it into a Cursor chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
In Cursor’s Agent chat, type / and pick git-machete
Checked against official docs Nov 12, 2026 · Source: cursor.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.cursor/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
In Cursor’s Agent chat, type / and pick git-machete
Option 1Let the AI install it
For other apps that read skills. The sentence gives the paths for Claude Code, Codex and Cursor so the AI picks the one for your app · Copy this sentence into the app’s chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Checked against official docs Nov 12, 2026 · Source: code.claude.com, learn.chatgpt.com, cursor.com
For Terminal users
Other apps that support Agent Skills (such as Gemini CLI or GitHub Copilot) use different folders. Check that app’s guide, then copy the folder with the SKILL.md there.
Skill folders checked against the official Claude Code, Codex and Cursor guides on Nov 11, 2026
View the original SKILL.md
The text below comes from the maker’s repo, not from PopNx MCP
Showing the first 8,000 characters · Open the full file on GitHub
---
name: git-machete
description: Use whenever invoking the `git machete` CLI to organize branch chains, compute fork points, run stacked rebases/merges, or manage GitHub/GitLab PR/MR chains - especially in a repo that already has a `.git/machete` file. Lists which subcommands modify `.git/machete`, run rebase/merge, run hooks, or read stdin, so the agent can pick the right one and pass the right flags. Crucially, names the commands that MUST be invoked with `-y/--yes` (and the few that have no `-y` and therefore must NOT be invoked at all without a tty) so the agent never hangs on an interactive prompt. Also warns against hand-editing the `.git/machete` layout file.
---
# git-machete
`git machete` is a logic- and feature-heavy CLI for managing chains of branches, but it keeps almost no extra state of its own: the only user-visible file it owns is `.git/machete` (the "branch layout" - a tree of branches with parent/child relationships, fork points and PR/MR annotations). It also maintains a transparent merge-base cache for performance, which the user never needs to touch. Everything else - rebases, merges, pushes, status rendering, PR/MR creation - is driven straight off git and the hosting API.
If the repo has no `.git/machete` file yet (check with `git machete file && test -s "$(git machete file)"`), the layout has not been initialized: run `git machete discover -y` (or ask the user) before anything else.
**Do not run `git machete discover` against an already-initialized layout** unless the user explicitly asks for it. `discover` re-derives the entire layout from heuristics (recent commit dates, branch reachability) and silently overwrites any hand-curated ordering, parenting, or annotations the user has built up. Use the targeted commands (`add`, `slide-out`, hand-edit) for incremental changes.
## Hard rules - read first
1. **Prefer dedicated subcommands over hand-editing `.git/machete`** when one fits the task. You *can* edit the layout file directly, but parse errors are quiet, so reach for a subcommand whenever there is one that fits:
- `git machete add [-y] [<branch>] [--as-root|--onto <parent>]` - add a branch
- `git machete slide-out [<branch>...]` - remove a branch and re-parent its children (non-interactive by default; see rule 4 for `--delete`)
- `git machete anno [<text>]` - set/clear annotation on the current branch
- `git machete rename <new-name>` - rename a local branch *and* its layout entry (use this instead of `git branch -m`)
The layout file grammar is small: one branch per line, each child indented one level deeper than its parent, with an optional annotation after whitespace on the same line. Any consistent indent unit works (a tab or N spaces), but the same unit must be used throughout the file.
For operations with no dedicated command (e.g. reparenting an existing branch, splitting one branch into two, ad-hoc reordering of siblings), hand-edit `.git/machete` directly. The file is small and brittle: edit it in place with the agent's structured editing tool (`StrReplace` / equivalent string-replacement primitive), not by piping it through `sed`/`awk` or rewriting it from a shell heredoc - one stray space changes the parent/child relationship silently. Recommended sequence:
1. `MACHETE="$(git machete file)"` - resolve the actual path (worktree/submodule-aware).
2. `cp -a "$MACHETE" "$MACHETE~"` - back up; the file is NOT tracked by git, so this is your only undo.
3. Read the file, perform a structured in-place edit (preserve the existing indent unit), write it back.
4. `git machete status` - verify the parse. If it errors, restore with `cp -a "$MACHETE~" "$MACHETE"`.
When indenting, match the unit already used in the file (could be a tab or any number of spaces, but it must stay consistent throughout). For a brand-new layout, use two spaces.
In the common case the layout file lives at `.git/machete` and hard-coding that is fine. The two exceptions are submodules (`.git/modules/<path>/machete`) and linked worktrees with `git config machete.worktree.useTopLevelMacheteFile false` (`.git/worktrees/<wt-name>/machete`); when in doubt, `git machete file` always resolves correctly.
2. **Register every new branch in the layout.** Whenever you create a branch as part of the user's actual work (`git checkout -b ...`, `git switch -c ...`, `git branch ...`), follow it with `git machete add -y [--onto <parent>]` so the new branch joins `.git/machete`.
In a git-machete-managed repo, the layout is the index of "branches I care about": users typically keep every branch they actively touch under git-machete, and the only branches deliberately left out are unrelated ones (someone else's WIP, throwaway branches checked out for a quick look).
Defer to the user if they ask you to leave a branch unmanaged - but don't *silently* skip the `add` step; ask if you're unsure.
3. **Never invoke a command that reads stdin without `-y/--yes`.** Commands with a `-y/--yes` flag: `add`, `advance`, `clean`, `delete-unmanaged`, `discover`, `traverse`, `github create-pr`, `gitlab create-mr`. Always pass `-y` from a non-interactive context (CI, agent, script).
4. **Some commands prompt and have no `-y` to suppress it - avoid or work around them**:
- `git machete update` - prompts only if the current branch is missing from the layout. **Workaround**: `git machete add -y` first, then `git machete update`.
- `git machete status` - prompts to slide out stale branches when stdout is a tty. **Workaround**: pipe through `| cat` or redirect, or use `git machete status --color=never > /tmp/status.txt`.
- `git machete slide-out --delete ...` - prompts once per branch and the prompt can't be silenced. **Workaround**: run plain `git machete slide-out <branch>...` first, then `git branch -D <branch>...` yourself (or skip the `--delete` entirely). Plain `slide-out` (and `slide-out --removed-from-remote`) is non-interactive.
- `git machete go` *without* a direction - opens an interactive single-keystroke picker. **Never invoke this form from an agent.** Use `git machete go <direction>` (`up`/`down`/`prev`/`next`/`root`/`first`/`last`) instead, which is non-interactive (but may still prompt if `down` is ambiguous - prefer `git machete show down | head -1` for scripted child discovery).
- `git machete edit` - opens `$EDITOR`. **Never invoke this form from an agent.** Use the dedicated subcommands from rule 1, or hand-edit `.git/machete` for the cases that have no subcommand.
5. **Plumbing commands have stable output across minor versions** and are safe for scripting. Use these for any "I need to read state from git-machete" task:
- `git machete file` - absolute path of `.git/machete`
- `git machete fork-point [--inferred] [<branch>]` - prints fork-point SHA on stdout (and only that)
- `git machete is-managed [<branch>]` - exit code 0 if managed, non-zero otherwise; **no stdout**
- `git machete list <category> [<branch>]` - newline-separated branch names; categories: `managed`, `addable`, `childless`, `slidable`, `slidable-after <branch>`, `unmanaged`, `with-overridden-fork-point`
- `git machete show <direction> [<branch>]` - newline-separated branch names for the given direction
- `git machete version` - prints `git-machete version X.Y.Z`
All other commands' stdout/stderr formatting may change between minor versions, including `status`.
6. **To open a PR/MR, use `git machete github create-pr -y` (or `gitlab create-mr -y`), not raw `gh pr create` / `glab mr create`.**
The machete subcommand does three things the hosting CLI doesn't:
- sets the PR/MR base to the branch's *parent in the layout*, not the repo default branch (correct for stacked PRs);
- writes the new PR/MR number back onto the branch in `.git/machete` so subsequent `status` / `traverse` / `retarget-{pr,mr}` see it;
- uses `.git/info/description` for the default PR title.
The host's own CLI is only the right tDiscussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
From GitHub
- GitHub stars
- 1,149
- Maker
- VirtusLab
- License
- MIT
- Last code change
- Nov 16, 2026
- SKILL.md files in the repo (including translated copies and templates)
- 1
- Topics
- cli, git, merge, rebase