Skip to content

Git to Hug Translation Guide ​

Transitioning from Git to Hug? This guide maps your existing Git mental models to Hug's humane commands. Find the Git command you know, see its Hug equivalent, and understand why Hug's approach is better.

How to Use This Guide

  • Look up Git commands you already know in the tables below
  • Learn the Hug equivalent and its memory hook
  • Understand the benefits of Hug's approach
  • Progressive learning: Start with essentials, expand to advanced as needed

Why Hug Improves on Git ​

Git is powerful but its UX was designed for plumbing, not humans. Hug adds a humane layer:

Better Mental Model ​

  • Verbs over flags: hug bc instead of git checkout -b
  • Progressive safety: Shorter commands = safer (hug a stages tracked only, hug aa stages everything)
  • Semantic prefixes: Commands grouped by purpose (s* = status, w* = working dir, h* = HEAD)

Clearer Intent ​

  • Named operations: hug h back vs git reset --soft HEAD~1
  • Explicit danger: hug h rewind makes destructive intent obvious
  • Auto-backups: Destructive operations create backup branches automatically

Built-in Safety ​

  • Confirmation prompts: Destructive commands ask for verification
  • Dry-run mode: Preview operations with --dry-run
  • Sensible defaults: Interactive selection, scoped operations

Coming from Git?

You already understand Git's concepts (commits, branches, staging). Hug just gives you better commands to manipulate them. Think of it as a Git UX upgrade.

Essential Commands (Tier 1) ​

These are the commands you'll use daily. Master these first.

Status & Inspection ​

See what's changed in your repository.

Git CommandHug EquivalentMemory HookWhy Hug is Better
git statushug slStatus + ListCleaner colored output, shows tracked files only by default
git status -uhug slaStatus + List AllConsistent naming, clear intent
git diffhug suStatus + UnstagedShows patch + stats automatically
git diff --stagedhug ssStatus + StagedConsistent naming, auto stats
git diff HEADhug swStatus + WorkingCombined view of all changes

Key insight: Hug's s* commands are all about seeing your repository state. The suffix tells you what to look at.

Staging ​

Prepare changes for commit.

Git CommandHug EquivalentMemory HookWhy Hug is Better
git add <files>hug aAdd trackedStages tracked only (safer default)
git add -Ahug aaAdd AllClear intent, shorter to type
git add -phug apAdd + PatchConsistent prefix, easier to remember
git reset <files>hug us <files>UnStageClear unstage operation
git resethug usaUnStage AllExplicit unstage all

Key insight: Hug separates staging (a*) from unstaging (us*), making operations reversible and intentional.

Commits ​

Save your changes to history.

Git CommandHug EquivalentMemory HookWhy Hug is Better
git commithug cCommitWorks with staged, shorter to type
git commit -a -mhug caCommit AllOne command vs flag combo
git commit -a -A -mhug caaCommit All AllIncludes untracked files explicitly
git commit --amendhug cmodCommit MODifyClearer intent, safer workflow

A Critical Difference

hug cmod (amend) adds staged files to the last commit. Always run hug sls first to check what's staged, or use hug usa to unstage everything if you only want to change the message.

Key insight: Hug's c* commands follow a brevity hierarchy: c (staged only) β†’ ca (all tracked) β†’ caa (everything).

Branching ​

Manage parallel development.

Git CommandHug EquivalentMemory HookWhy Hug is Better
git branchhug blBranch ListVerbs, not nouns
git branch -ahug blaBranch List AllConsistent naming
git checkout -bhug bcBranch CreateSingle command, no flags
git switch / git checkouthug bBranchInteractive menu by default
git branch -dhug bdelBranch DELeteSafer default, checks for merged status

Interactive Branch Switching

Run hug b without arguments to get an interactive menu showing all branches. Use hug br for remote branches only.

Key insight: Hug uses verbs for actions (list, create, delete) instead of Git's overloaded checkout command.

Log & History ​

View your project's timeline.

Git CommandHug EquivalentMemory HookWhy Hug is Better
git log --onelinehug lLogDefault is useful, no flags needed
git log -phug llLog LongConsistent naming, includes patches
git log --stathug lolLog Outgoing LongMemory hooks for variants
git log --grep="term"hug lf "term"Log FilterShorter, clearer intent
git log -S"code"hug lc "code"Log CodeSearch changes, not just messages

Outgoing Commits

Before pushing, run hug lol (Log Outgoing Long) to see exactly what will be pushed. It shows commits, file stats, and patches.

Key insight: Hug's l* commands use memorable suffixes to indicate what you're looking at (outgoing, filter, code, file).

Syncing with Remote ​

Push and pull changes.

Git CommandHug EquivalentMemory HookWhy Hug is Better
git push -uhug bpushBranch PushSets upstream automatically
git pullhug bpullBranch PullFast-forward only (safer, rejects merge commits)
git pull --rebasehug bpullrBranch Pull RebaseLinear history, explicit intent
git push --forcehug bpushfBranch Push ForceSafer force-push (requires --force-with-lease equivalent)

Safe by Default

hug bpull only fast-forwards. If a merge or rebase would be needed, it fails and asks you to decide. This prevents accidental merge commits.

Key insight: Hug's sync commands are branch-scoped (b*), making it clear you're operating on branch relationships.

Common Workflow Migrations ​

Real-world translations of Git patterns to Hug patterns.

"I used to git commit --amend constantly" ​

Old Git pattern:

bash
# Make a change
echo "fix" >> file.txt
git add file.txt
git commit --amend --no-edit

New Hug pattern:

bash
# Make a change
echo "fix" >> file.txt
hug a file.txt
hug cmod -m "original message"  # Amend with staged files

Why Hug is better:

  • hug cmod makes amend intent explicit
  • Safer workflow: requires checking staged files first
  • Auto-creates backup branch (hug-backup-*)

"I used to git stash for context switching" ​

Old Git pattern:

bash
# Park current work
git stash push -m "work in progress"

# Switch to other task
git checkout other-branch
# ... work ...

# Switch back
git checkout main
git stash pop

New Hug pattern:

bash
# Park current work
hug wip "work in progress"    # Creates WIP/YY-MM-DD/HHmm.slug branch

# Switch to other task
hug b other-branch
# ... work ...

# Switch back and integrate
hug b main
hug w unwip WIP/...           # Squash-merges the WIP branch back

Why Hug is better:

  • WIP branches are permanent (won't vanish like stash)
  • Shareable: Can push WIP branches for backup or feedback
  • Versioned: Can add multiple commits to a WIP branch
  • Visible: Appears in hug bl, not hidden in a stash list

"I used to git reset --soft to fix commits" ​

Old Git pattern:

bash
# Go back 2 commits, keeping changes staged
git reset --soft HEAD~2
# Make changes
git add ...
git commit -m "fixed commit"

New Hug pattern:

bash
# Go back 2 commits, keeping changes staged
hug h back 2
# Make changes
hug a ...
hug c -m "fixed commit"

Why Hug is better:

  • hug h back clearly says "HEAD goes back"
  • Auto-creates backup branch before moving
  • Consistent with other h* commands (undo, rewind, rollback)

"I used to git clean to remove untracked files" ​

Old Git pattern:

bash
# Remove untracked files
git clean -fd

# Nuke everything (tracked + untracked)
git reset --hard HEAD
git clean -fd

New Hug pattern:

bash
# Remove untracked/ignored files
hug w purge <path>

# Nuke everything (tracked + untracked)
hug w zap <path>

Why Hug is better:

  • Progressive destructiveness: purge < zap
  • Clear intent: zap sounds dangerous (and is)
  • Confirmation prompts prevent accidents
  • --dry-run to preview first

Key Concept Shifts ​

Hug isn't just different commandsβ€”it's a different philosophy.

Stash β†’ WIP Workflow ​

Git's stash:

  • Single temporary holding area
  • Stack-based (LIFO)
  • Lost if machine fails or you rebase
  • Cryptic listing (git stash list)

Hug's WIP:

  • Real, timestamped branches (WIP/YY-MM-DD/HHmm.slug)
  • Multiple WIPs can coexist
  • Permanent, shareable, pushable
  • Clear naming in branch list

Reset Modes β†’ h* Commands ​

Git's reset modes (one command, different flags):

  • git reset --soft β†’ keeps changes staged
  • git reset (mixed) β†’ keeps changes unstaged
  • git reset --hard β†’ discards everything

Hug's distinct commands (separate verbs):

  • hug h back β†’ HEAD back, keeps staged
  • hug h undo β†’ HEAD back, keeps unstaged
  • hug h rewind β†’ HEAD back, discards all

Why this matters:

  • Explicit intent prevents mistakes
  • Muscle memory builds on meaningful verbs
  • Auto-backups on all operations

Safety by Default ​

Git: Assumes you know what you're doing

  • git reset --hard destroys work immediately
  • git clean -fd deletes without asking
  • Force push is one flag away

Hug: Assumes you might make mistakes

  • Destructive commands require confirmation
  • --dry-run to preview operations
  • Auto-backups on HEAD operations
  • Force operations require explicit intent

Progressive Expansion ​

Ready for more? These commands are useful for power users.

Intermediate Commands (Tier 2) - Click to expand

Undo Operations ​

Git CommandHug EquivalentMemory HookWhy Hug is Better
git reset --soft HEAD~1hug h backHEAD BackClearer, keeps staged, auto-backup
git reset HEAD~1hug h undoHEAD UndoKeeps unstaged, auto-backup
git reset --hard HEAD~1hug h rewindHEAD RewindMore explicit danger, auto-backup
git reverthug revertRevertSame concept, Hug auto-backups first

Cleaning Operations ​

Git CommandHug EquivalentMemory HookWhy Hug is Better
git checkout -- filehug w discard <file>Working dir DiscardConsistent w* prefix
git reset --hardhug w wipe-allWorking dir Wipe AllProgressive danger level
git clean -fdhug w purge <path>Working dir PurgeConsistent prefix, scoped
git reset --hard && git clean -fdhug w zap <path>Working dir ZapSingle command, explicit danger

Progressive destructiveness: discard < wipe < purge < zap < rewind

Merge Operations ​

Git CommandHug EquivalentMemory HookWhy Hug is Better
git merge --squashhug mMergeSquash by default (safer)
git mergehug mkeepMerge KeepExplicit about keeping commits
git merge --ff-onlyhug mffMerge Fast-ForwardClear intent, safer
git merge --aborthug maMerge AbortConsistent abort pattern
Advanced Commands (Tier 3) - Click to expand

Rebase ​

Git CommandHug EquivalentMemory HookWhy Hug is Better
git rebasehug rbRebaseConsistent r* prefix
git rebase -ihug rbiRebase InteractiveEasier to remember
git rebase --continuehug rbcRebase ContinueConsistent continue/abort pattern
git rebase --aborthug rbaRebase AbortConsistent continue/abort pattern

File Inspection ​

Git CommandHug EquivalentMemory HookWhy Hug is Better
git blamehug fblameFile Blamef* prefix for file operations
git log --follow -p filehug llfp <file>Log Lookup File + PatchComposable, memorable
git log --follow --stat filehug llfs <file>Log Lookup File + StatComposable, memorable

Search Operations ​

Git CommandHug EquivalentMemory HookWhy Hug is Better
git log --grep="term"hug lf "term"Log FilterShorter, clearer
git log -S"code"hug lc "code"Log CodeSearch code changes
git log --author="name"hug lau "name"Log Author UserClear author search
git log --since="date"hug ld --since="date"Log DateDate-based filtering

Tagging ​

Git CommandHug EquivalentMemory HookWhy Hug is Better
git taghug tTagSimple list
git tag <name>hug tc <name>Tag CreateLightweight by default
git tag -a <name>hug ta <name>Tag AnnotatedExplicit annotation
git show <tag>hug ts <tag>Tag ShowConsistent show pattern

Computational Analysis (Hug Exclusive) ​

These have no Git equivalentβ€”they're impossible with Git's plumbing alone.

Hug CommandMemory HookWhat It Does
hug analyze co-changes <file>Co-changesFind files related to a specific file (--all for repo-wide coupling)
hug analyze expert <file>ExpertWho knows this code? (recency-weighted ownership)
hug analyze deps <commit>DependenciesFind related commits via file overlap
hug analyze activityActivityWhen/how does your team commit?
hug stats file <file>Stats FileFile metrics (commits, authors, churn)

Why No Git Equivalent?

These require graph algorithms, statistical analysis, and data processing beyond Git's scope. Hug uses Python helpers to compute insights from Git history.

Next Steps ​

You've got the essentialsβ€”now dive deeper:

Still Using Git Commands?

Hug can run Git commands too. If you forget the Hug equivalent, type your Git command as usualβ€”Hug will pass it through to Git.

Quick Reference Card ​

Print this out for your desk until you build muscle memory:

I want to...GitHug
See statusgit statushug sl
Stage trackedgit addhug a
Stage allgit add -Ahug aa
Commit stagedgit commithug c
Commit all trackedgit commit -a -mhug ca
Amend last commitgit commit --amendhug cmod
Create branchgit checkout -bhug bc
Switch branchgit checkouthug b
List branchesgit branchhug bl
Show loggit log --onelinehug l
Show diffgit diffhug su
Show staged diffgit diff --stagedhug ss
Pushgit push -uhug bpush
Pull (ff-only)git pullhug bpull
Park workgit stashhug wip
Undo last commit (keep staged)git reset --soft HEAD~1hug h back
Undo last commit (keep unstaged)git reset HEAD~1hug h undo
Discard file changesgit checkout -- filehug w discard file

Released under the Apache 2.0 License.