git-wth — Git What The Heck

See your repo's
branch state at a glance

A fast Go rewrite of git-wtf. Shows how branches relate to remotes and integration branches in a readable, color-coded summary.

~/projects/myapp
$ git wth Local branch: main [x] in sync with remote Feature branches: [x] feature/auth is merged in [x] feature/dark-mode is merged in [ ] feature/dashboard is NOT merged in (3 commits ahead) a4f9c12 Add dashboard layout b8e3d77 Add chart components c1209ab Wire up data fetching { } feature/experimental is NOT merged in (1 commit ahead) f3301e5 Prototype new recommendation engine Integration branches: [x] merged into main [ ] NOT merged into develop (2 commits ahead)

What it shows you

📡

Remote sync status

See at a glance whether your branch is ahead, behind, or in sync with its remote tracking branch.

🌳

Feature branches

Shows which feature branches are merged into the current branch and which still have outstanding commits.

🔀

Integration branches

Reports whether the current branch has been merged into integration branches like main or develop.

🎨

Color-coded output

Green for good, uncolored for action needed. Respects NO_COLOR and terminal detection.

Installation

Go install
go install github.com/abatkin/git-wth@latest
Build from source
git clone https://github.com/abatkin/git-wth.git
cd git-wth
go build -o git-wth .
mv git-wth /usr/local/bin/git-wth

Once the binary is on your $PATH as git-wth, Git picks it up automatically as git wth.

Requires Go 1.21+ to build from source. No runtime dependencies.

Options

Run git wth [branch...] to inspect one or more branches. Defaults to the current branch.

Flag Long form Description
-l --long Include author info and date for each commit
-a --all Show branches across all remotes, not just origin
-A --all-commits Show all commits, not just the configured maximum
-s --short Do not show individual commits
-k --key Show the output key explaining bracket notation
-r --relations Show relation to feature and integration branches
-h --help Show usage and exit
--version Print the version and exit
--dump-config Print the current configuration as YAML

Short flags can be combined: -lk is equivalent to -l -k. A bare -- ends option parsing; anything after is treated as a branch name.

Configuration

Bootstrap a config file with:

git wth --dump-config > .git-wthrc

The config file is YAML. git-wth searches for it walking up from the current directory, then in $XDG_CONFIG_HOME/git-wth/config, then ~/.git-wthrc.

# .git-wthrc
integration-branches:
  - heads/main
  - heads/develop
ignore:
  - heads/scratch
max_commits: 5

Local branches must be prefixed with heads/. Remote branches use remotes/<remote>/<branch>. The tool also reads legacy .git-wtfrc files for drop-in compatibility with git-wtf.

Output key

SymbolMeaning
[ ]Branch exists locally and remotely
( )Branch exists only locally
{ }Branch exists only on a remote
[x]Merged (locally and remotely)
[~]Merged locally only
    (space)Not merged