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
| Section | Details |
|---|---|
| Branch | Current branch name, or detached HEAD indicator |
| Tracking | Remote tracking branch with ahead/behind counts |
| vs main | Ahead/behind relative to the HEAD branch (main/master) |
| Last commit | Short hash, message, and age |
| Working tree | Modified, staged, and untracked file counts, or “clean” |
| Stash | Number of stash entries, or “empty” |
| Active ops | Warnings for merge, rebase, or cherry-pick in progress |
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:Details
Details
- 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