Skip to content

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 slStatus + 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

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

CommandMemory HookSummary
hug sStatus snapshotColored summary of staged/unstaged changes
hug slStatus + ListStatus with listed tracked changes
hug slaStatus + List AllStatus including untracked files
hug ssStatus + StagedShow staged diff
hug suStatus + UnstagedShow unstaged diff
hug swStatus + WorkingCombined staged and unstaged diff
hug aAdd trackedStage tracked changes
hug aaAdd AllStage tracked and untracked changes
hug usUnStageUnstage specific files
hug usaUnStage AllUnstage 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.
  • 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).

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).

Related: Compare against recent commits with hug lp or hug 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.
  • 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 or hug 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 or hug 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.

  1. hug sl to verify tracked files.
  2. hug ap to stage only the relevant hunk.
  3. hug ss to double-check the staged diff, then hug c "Describe change".
  4. hug bpush to publish.

Scenario: Recover from Experimental Edits

Goal: Restore a clean working tree after a spike.

  1. hug sla to spot all touched files.
  2. hug w wip "Spike backup" for a safety net.
  3. hug w discard-all for tracked changes, followed by hug w purge for generated files.
  4. 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 with hug ss and hug su to ensure nothing surprising slips in.
  • Combine hug sl with hug 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 from hug ss.

Released under the Apache 2.0 License.