Tutorial - Part 9: Automating workflow with traverse
January 2, 2026 · View on GitHub
If you have a chain of branches like feature-2 → feature-1 → develop,
and develop gets new commits, both feature-1 and feature-2 will become out of sync.
Updating them one by one with git machete update is fine, but git-machete can do better.
The traverse command
The traverse command is a core feature of git-machete.
To walk through your branch tree and sync your branches, run:
git machete traverse
For each branch that needs attention, it will ask you:
- Rebase onto parent?
- Push to remote?
- Pull from remote?
- Slide out (if it's already merged)?
Common options
You can make traverse even more automated with flags:
--fetch— rungit fetchbefore starting.--whole— walk through the entire branch tree instead of starting from the current branch.-W— equivalent to--fetch --whole.--yesor-y— automatically confirm all actions.
Example workflow
git machete traverse -W -y
This single command will:
- Fetch latest changes from the server.
- Walk through all branches in your layout.
- Rebase any out-of-sync branches.
- Push or pull branches as needed.
- Slide out merged branches.
All without asking for confirmation.
< Previous: Squashing and reapplying | Next: Fast-forwarding with advance >