Skip to main content
gx context (alias gx ctx) shows a compact summary of your current repo state: branch, tracking status, last commit, working tree, stash count, and any active operations.

Usage

What It Shows

Example Output

When in detached HEAD state, gx shows the short hash instead of a branch name and prints WARN You are in detached HEAD state.

Active Operation Warnings

If a merge, rebase, or cherry-pick is in progress, gx shows a warning at the bottom:
gx context is a read-only command. It never modifies your repo. Run it as often as you want to get your bearings.
  • Tracking status is shown only if the branch has an upstream configured
  • The “vs main” line is hidden when you are already on the HEAD branch
  • Stash count shows “empty” when there are no stash entries
  • Working tree shows “clean” (in green) when there are no modifications