This tutorial covers the core features of git-machete.
git-machete is a robust tool that simplifies your git workflows.
It's particularly useful when working with many branches and stacked pull requests.
In modern software development, we often work on multiple features simultaneously. Sometimes these features depend on each other, leading to a chain of branches:
feature-3 → feature-2 → feature-1 → develop
Another very common case is when you have a refactor or a bugfix that a feature depends on before it can be merged. Stacking branches allows you to continue working on your feature while the supporting changes are under review:
feature → refactor → bugfix → develop
When develop moves forward, you suddenly have to rebase bugfix onto develop,
then refactor onto bugfix, and finally feature onto refactor.
Doing this manually is tedious and error-prone.
git-machete provides:
- Bird's eye view — see all your branches and their relationships at a glance.
- Automatic
status— know instantly which branches are in sync, which need a rebase, and which are merged. - Simplified syncing — rebase, push, and pull multiple branches with a single command.
- Integration with GitHub and GitLab — keep PR structure & descriptions in sync with your local state.
This tutorial is divided into bite-sized chapters that will take you through the most important features of git-machete. We'll cover:
- Installation and setup
- Discovering and editing branch layout
- Understanding
status - Using branch annotations
- Navigating between branches
- Updating a branch with a rebase
- Squashing and reapplying
- Automating workflow with
traverse - Fast-forwarding with
advance - Cleaning up with
slide-out - GitHub/GitLab integration