git-branch-status
A command line tool for displaying git branch colored by status, like zsh's vcs_info.

Installation
From crates.io
Prebuilt binaries
Download the archive for your platform from the
releases page, extract
it, and place the git-branch-status binary somewhere on your PATH (Windows
builds are distributed as a .zip):
From source
&&
Usage
Zsh
Add the following to ~/.zshrc:
# ~/.zshrc
RPROMPT='$(git branch-status --mode zsh)'
Zsh with Starship 🚀
Add the following to ~/.config/starship.toml:
= 1000
= """
$directory\
$custom\
$line_break\
$character"""
[]
= "git branch-status --mode zsh"
= "git rev-parse --is-inside-work-tree 2>/dev/null"
= " on $output"
Starship aborts any custom command that runs longer than
command_timeout (500ms by default) and
shows a warning instead of its output. In large repositories git-branch-status
can take longer than that, so raise command_timeout (e.g. to 1000ms) if the
module disappears or you see a timeout warning.
Benchmark
Against vcs_info
Run ./scripts/bench-vcs-info.sh. git-branch-status is about 5x faster than vcs_info on M1 MacBook Pro (2021).
git-branch-status on its own
Run ./scripts/bench.sh to benchmark git-branch-status alone with
hyperfine. This is handy when working on
performance, since it reports the mean, standard deviation, and min/max across
many runs.
)
)