Skip to content
Probably the sharpest git repository organizer & rebase workflow automation tool you've ever seen ;)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
completion Hightlight fork point in 'status --list-commits' in case of a yellow … May 7, 2019
hook_samples Implement hooks + provide samples (#14) May 7, 2019
.gitignore Provide zsh completion (#21) Mar 12, 2019
.stestr.conf Setup project in python way Feb 23, 2019
.travis.yml Temporarily use Python 2.7 for pep8 toxenv May 5, 2019 Exclude the no-op rebase case from the adjusted reflog Dec 24, 2018
Makefile Add entry in README for Arch AUR package May 22, 2019
requirements.txt Setup project in python way Feb 23, 2019
setup.cfg Provide zsh completion (#21) Mar 12, 2019


Join the chat at TravisCI build status

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

  • Automatic discovery of branch relations (git machete discover)

  • 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


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.

Note: as for now git-machete runs on Python 2.7, we're planning to migrate to Python 3 soon (#35).

Using AUR (Arch Linux only)

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

Using make with sudo

Run the following commands to install git machete:

$ git clone --depth=1
$ cd git-machete
$ sudo make install

Using with sudo

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

$ git clone --depth=1
$ cd git-machete
$ python build
$ sudo python install

Using without sudo

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

$ git clone --depth=1
$ cd git-machete
$ python install --user

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

Quick start

$ cd your-repo/
$ git machete discover
  # (see and possibly edit the suggested layout of branches)
$ 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.

You can’t perform that action at this time.