Skip to main content

Probably the sharpest git repository organizer & rebase workflow automation tool you've ever seen

Project description


Join the chat at TravisCI build status PyPI package

git machete is a versatile tool for organizing your git repo, including features like:

  • Neat, customizable git machete status that shows what branches are in sync with their parent branch/remote tracking branch and which of them need to be rebased/pulled/pushed

git machete status

  • Semi-automatic traversal of the branches that helps you effortlessly rebase and push/pull the branches you care for (git machete traverse)

git machete traverse

  • Automatic discovery of branch relations (git machete discover)


We suggest a couple of alternative ways of installation.

Bash and zsh completion scripts are provided in completion/ directory, see wiki for their installation instructions.

git-machete works under both Python 2.7 and Python 3.x.

Using Homebrew (macOS)

brew tap VirtusLab/git-machete
brew install git-machete

Using PPA (Ubuntu)

Tip: run sudo apt-get install -y software-properties-common first if add-apt-repository is not available on your system.

sudo add-apt-repository ppa:virtuslab/git-machete
sudo apt-get update
sudo apt-get install -y python3-git-machete

Using rpm (Fedora/RHEL/CentOS/openSUSE...)

Download the rpm package from the latest release and install either by opening it in your desktop environment or with rpm -i git-machete-*.noarch.rpm.

Using AUR (Arch Linux)

Install the AUR package git-machete using an AUR helper of your preference.

Using Nix (macOS & most Linux distributions)

On macOS and most Linux distributions, you can install via Nix:

nix-channel --add unstable  # if you haven't set up any channels yet
nix-env -i git-machete

Using pip with sudo (system-wide install)

You need to have Python and pip installed from system packages.

sudo -H pip install git-machete

Using pip without sudo (user-wide install)

You need to have Python and pip installed from system packages.

pip install --user git-machete

Please verify that your PATH variable has ${HOME}/.local/bin/ included.

Quick start

cd your-repo/
git machete discover --checked-out-since='2 weeks ago'  # increase/decrease the timespan if you want more/less old branches included
  # (see and possibly edit the suggested layout of branches - branch layout is always kept as text file .git/machete)
git machete go root
git machete traverse
  # (put each branch one by one in sync with its parent and remote counterpart)


Take a look at for a guide on how to use the tool.

The more advanced features like automated traversal, upstream inference and tree discovery are described in the second part of the series:


To develop that project and run tests locally it is needed to have Python installed with tox.

Use tox -e venv to setup virtual environment to work on that project in your favorite IDE. Use .tox/venv/bin/python as a reference python interpreter in your IDE.

To run tests execute command tox.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for git-machete, version 2.12.10
Filename, size File type Python version Upload date Hashes
Filename, size git_machete-2.12.10-py2.py3-none-any.whl (27.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size git-machete-2.12.10.tar.gz (29.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page