Branch annotations allow you to attach short notes to your branches.
These notes are stored in the .git/machete file and displayed in the status output.
To add a note to the current branch, run:
git machete anno "your note here"If you run git machete status, you will see your note next to the branch name.
Since annotations are just text in the layout file, you can also edit them by running git machete edit.
Anything that follows the branch name on the same line (separated by at least one space) is considered an annotation.
- Primarily, to track pull request numbers (see below).
- Keep track of the purpose — remind yourself what a branch is for.
- Status markers — mark branches as "DO NOT MERGE", "WIP", or "Ready for review".
- Collaboration — if you share your
.git/machetefile (though it's usually local), others can see your notes.
To automatically annotate your branches with information from GitHub or GitLab, run:
git machete anno --sync-github-prs(or --sync-gitlab-mrs) to fetch PR/MR numbers and authors for all branches that have them.
Note: in case of private repositories, this requires authorization with an API token — see the chapter on GitHub/GitLab integration.
< Previous: Understanding status | Next: Navigating between branches >