Status & Staging (s*, a*) โ
Status and staging commands in Hug provide clear views of your repo state and easy ways to stage/unstage changes. Prefixed with s for "status" and a for "add/stage."
These enhance Git's status and add with colored summaries, patches, and smart defaults.
Mnemonic Legend
- Bold letters in command names highlight the initials that build each alias (for example,
hug slโ Status + List). - The Memory Hook column repeats that breakdown so you can build muscle memory quickly.
- Safety icons used below: โ safe/preview-only ยท โ ๏ธ requires caution or forces data removal ยท ๐ confirms before running.
On This Page โ
- Quick Reference
- Status Commands (s*)
- Staging Commands (a*)
- Unstaging
- Stash Commands (s* overlap)
- Scenarios
- Tips
- Coverage Checklist
Command Family Map
Looking for other families? Try HEAD Operations (h*) for resets, Working Directory (w*) for cleanups, or Logging (l*) to inspect history before staging.
Quick Reference โ
| Command | Memory Hook | Summary |
|---|---|---|
hug s | Status snapshot | Colored summary of staged/unstaged changes |
hug sl | Status + List | Status with listed tracked changes |
hug sla | Status + List All | Status including untracked files |
hug ss | Status + Staged | Show staged diff |
hug su | Status + Unstaged | Show unstaged diff |
hug sw | Status + Working | Combined staged and unstaged diff |
hug a | Add tracked | Stage tracked changes |
hug aa | Add All | Stage tracked and untracked changes |
hug us | UnStage | Unstage specific files |
hug usa | UnStage All | Unstage everything |
Status Commands (s*) โ
Basic Status โ
hug s: Status snapshot- Description: Quick colored summary of staged/unstaged changes (no untracked files).
- Example:
hug s(always safe, no args). - Safety: โ Read-only overview; nothing is modified.
hug sl: Status + List- Description: Status with a list of uncommitted tracked files (mirrors plain
git status). - Example:
hug sl - Safety: โ Read-only.
Visual Examples: hug sl in Different States
Clean Working Directory:

With Unstaged Changes:

With Staged Changes:

Mixed (Staged + Unstaged):

- Description: Status with a list of uncommitted tracked files (mirrors plain
hug sla: Status + List All- Description: Full status including untracked files so you can see new additions.
- Example:
hug sla - Safety: โ Read-only (includes untracked context only).
hug sli: Status + List Ignored- Description: Status plus ignored and untracked files to surface items in
.gitignore. - Example:
hug sli - Safety: โ Read-only (great for spotting generated artifacts).
- Description: Status plus ignored and untracked files to surface items in
Related: After inspecting status, jump to Detailed Patches for inline diffs or hop over to Working Directory (w*) to clean up files you find.
Scenario
Task: Sanity-check your working tree before pushing.
Flow: Run hug sl for a tracked summary, then hug sla if you need to confirm no new files are lingering.
Detailed Patches โ
Show diffs inline for better inspection.
hug ss [file]: Status + Staged diff- Description: Status + staged changes patch (for a file or all files). Use
--to interactively select from staged files. - Example:
hug ss # Show all staged changes hug ss src/app.js # Show staged changes for specific file hug ss -- # Interactive file selection from staged files - Safety: โ Read-only diff preview.
- Description: Status + staged changes patch (for a file or all files). Use
hug su [file]: Status + Unstaged diff- Description: Status + unstaged changes patch. Use
--to interactively select from unstaged files. - Example:
hug su # Show all unstaged changes hug su file.txt # Show unstaged changes for specific file hug su -- # Interactive file selection from unstaged files - Safety: โ Read-only diff preview.
- Description: Status + unstaged changes patch. Use
hug sw [file]: Status + Working directory diff- Description: Status + working directory patch (staged + unstaged). Use
--to interactively select from changed files. - Example:
hug sw # Show all working directory changes hug sw . # Show all changes in current directory hug sw -- # Interactive file selection from changed files - Safety: โ Read-only diff preview.
- Description: Status + working directory patch (staged + unstaged). Use
hug sx: Status eXpress- Description: Working tree summary with unstaged focus. Options:
--no-color. - Example:
hug sx - Safety: โ Read-only summary (fast overview).
- Description: Working tree summary with unstaged focus. Options:
Related: Compare against recent commits with
hug lporhug lbefore deciding whether to amend or discard changes.
Scenario
Task: Review your commit before amending.
Flow: Run hug ss to verify staged fixes, then hug su to ensure no leftovers remain before hug caa.
Staging Commands (a*) โ
hug a [files...]: Add tracked- Description: Stage tracked changes (or specific files if provided). If no args, stages updates only. Use
--to trigger interactive file selection UI. - Example:
hug a # Stage all tracked updates hug a src/ # Stage directory, including non-tracked files hug a -- # Interactive file selection (requires gum) - Safety: โ
Safe staging (reversible with
hug us).
- Description: Stage tracked changes (or specific files if provided). If no args, stages updates only. Use
hug aa: Add All- Description: Stage everything (tracked + untracked + deletions).
- Example:
hug aa(use carefully). - Safety: โ ๏ธ Sweeps all changes - run
hug slafirst to confirm what's included.
hug ai: Add + Interactive- Description: Interactive add menu (Git's
-i). - Example:
hug ai - Safety: โ Interactive preview before staging.
- Description: Interactive add menu (Git's
hug ap: Add + Patch- Description: Interactive patch staging (hunk-by-hunk).
- Example:
hug ap - Safety: โ Interactive hunk selection.
Related: Once staged, continue with Commits (c*) like
hug corhug caato record the snapshot.
Scenario
Task: Stage only your lint fixes.
Flow: Run hug ap to choose specific hunks, then hug ss to confirm before committing with hug c.
Unstaging โ
hug us <files...>: UnStage specifics- Description: Unstage specific files.
- Example:
hug us file.js - Safety: โ Only affects the index; your working tree stays untouched.
hug usa: UnStage All- Description: Unstage all files.
- Example:
hug usa - Safety: โ ๏ธ Clears the entire staging area - review with
hug slafterward.
hug untrack <files...>- Description: Stop tracking files but keep them locally (e.g., for secrets).
- Example:
hug untrack .env - Safety: โ ๏ธ Removes files from version control; make sure
.gitignorecovers them to prevent re-adding.
Related: If you need to toss changes entirely, jump to
hug w discardorhug w wipfor safe checkpoints.
Scenario
Task: You staged a compiled artifact by mistake.
Flow: Run hug us dist/app.js, add it to .gitignore, then hug untrack dist/ so it stays local only.
Scenarios โ
Scenario: Patch-and-Push
Goal: Ship a small change without noise.
hug slto verify tracked files.hug apto stage only the relevant hunk.hug ssto double-check the staged diff, thenhug c "Describe change".hug bpushto publish.
Scenario: Recover from Experimental Edits
Goal: Restore a clean working tree after a spike.
hug slato spot all touched files.hug w wip "Spike backup"for a safety net.hug w discard-allfor tracked changes, followed byhug w purgefor generated files.- Finish with
hug sto confirm you're clean.
Tips โ
- Use
hug s/hug slas your heartbeat commands; rerun them after every change to stay oriented. - When staging aggressively with
hug aa, follow withhug ssandhug suto ensure nothing surprising slips in. - Combine
hug slwithhug llffrom Logging (l*) to tie current work back to file history. - Share concise stand-up updates by pasting
hug sxoutput or attaching diffs fromhug ss.