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.
- 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).
- Example:
hug ss src/app.js
- Safety: ✅ Read-only diff preview.
hug su [file]
: Status + Unstaged diff- Description: Status + unstaged changes patch.
- Example:
hug su
- Safety: ✅ Read-only diff preview.
hug sw [file]
: Status + Working directory diff- Description: Status + working directory patch (staged + unstaged).
- Example:
hug sw .
- Safety: ✅ Read-only diff preview.
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 lp
orhug l
before 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.
- Example:
hug a # Stage all tracked updates hug a src/ # Stage directory, including non-tracked files
- Safety: ✅ Safe staging (reversible with
hug us
).
hug aa
: Add All- Description: Stage everything (tracked + untracked + deletions).
- Example:
hug aa
(use carefully). - Safety: ⚠️ Sweeps all changes - run
hug sla
first 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 c
orhug caa
to 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 sl
afterward.
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
.gitignore
covers them to prevent re-adding.
Related: If you need to toss changes entirely, jump to
hug w discard
orhug w wip
for 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 sl
to verify tracked files.hug ap
to stage only the relevant hunk.hug ss
to double-check the staged diff, thenhug c "Describe change"
.hug bpush
to publish.
Scenario: Recover from Experimental Edits
Goal: Restore a clean working tree after a spike.
hug sla
to spot all touched files.hug w wip "Spike backup"
for a safety net.hug w discard-all
for tracked changes, followed byhug w purge
for generated files.- Finish with
hug s
to confirm you're clean.
Tips
- Use
hug s
/hug sl
as your heartbeat commands; rerun them after every change to stay oriented. - When staging aggressively with
hug aa
, follow withhug ss
andhug su
to ensure nothing surprising slips in. - Combine
hug sl
withhug llf
from Logging (l*) to tie current work back to file history. - Share concise stand-up updates by pasting
hug sx
output or attaching diffs fromhug ss
.