Skip to main content
These commands are designed to make common tasks faster and more enjoyable.

wip

Create a quick work-in-progress commit with an auto-generated message.
wit wip [options] [suffix]

Options

OptionDescription
-a, --allStage all tracked files before committing

Arguments

ArgumentDescription
suffixOptional text to append to the WIP message

Examples

# WIP commit with staged files
wit wip

# Stage all tracked files and WIP commit
wit wip -a

# WIP with custom suffix
wit wip -a "fixing login bug"

Generated Messages

WIP: 2024-01-15 10:30 - 3 files changed
WIP: 2024-01-15 10:30 - fixing login bug
Use wit uncommit later to restore your WIP state and create a proper commit.

amend

Modify the last commit easily.
wit amend [options]

Options

OptionDescription
-m <message>New commit message
-a, --allStage all tracked files before amending

Examples

# Change the commit message
wit amend -m "Better commit message"

# Add staged changes to last commit (keep message)
wit add forgotten-file.ts
wit amend

# Stage all and amend
wit amend -a

Comparison with Git

Gitwit
git commit --amend -m "msg"wit amend -m "msg"
git add file && git commit --amend --no-editwit add file && wit amend

fixup

Create fixup commits for later squashing.
wit fixup <commit> [options]

Options

OptionDescription
-l, --listList recent commits to choose from

Examples

# Create fixup for specific commit
wit fixup HEAD~2

# List recent commits first
wit fixup -l
# Then choose one to fix up

snapshot

Create quick checkpoints without full commits.
wit snapshot <command> [options]

Commands

CommandDescription
create [name]Save current state as a snapshot
listList all snapshots
restore <id>Restore a snapshot
delete <id>Delete a snapshot

Examples

# Create a snapshot before risky changes
wit snapshot create "before refactor"

# List all snapshots
wit snapshot list

# Restore if something goes wrong
wit snapshot restore "before refactor"

# Clean up old snapshot
wit snapshot delete "before refactor"

Example Output

Snapshots:
  1. "before refactor" (10 minutes ago)
  2. "working login" (2 hours ago)
  3. "initial setup" (1 day ago)
Snapshots are lighter than commits and don’t appear in your commit history. They’re perfect for “save points” during risky operations.

cleanup

Find and remove merged or stale branches.
wit cleanup [options]

Options

OptionDescription
--dry-runPreview what would be deleted
--forceDelete without confirmation
--mergedOnly show merged branches
--staleOnly show stale branches
--days <n>Consider branches stale after N days (default: 30)

Examples

# See what branches can be cleaned
wit cleanup --dry-run

# Interactive cleanup with confirmation
wit cleanup

# Force cleanup without prompts
wit cleanup --force

# Find branches older than 60 days
wit cleanup --days 60 --stale

Example Output

Found 3 branches to clean up:

Merged branches:
  feature-login (merged 5 days ago)
  hotfix-typo (merged 2 weeks ago)

Stale branches:
  experiment-old (no commits for 45 days)

Delete these branches? [y/N]

stats

Show repository statistics and insights.
wit stats [options]

Options

OptionDescription
--allShow detailed statistics

Examples

# Basic stats
wit stats

# Detailed stats
wit stats --all

Example Output

Repository Statistics
=====================

Overview:
  Commits: 1,234
  Branches: 12
  Contributors: 8
  Files: 456
  Lines of code: 45,678

Top Contributors:
  1. Alice (456 commits)
  2. Bob (321 commits)
  3. Charlie (234 commits)

Languages:
  TypeScript: 78%
  JavaScript: 15%
  JSON: 5%
  Markdown: 2%

Activity:
  Most active day: Tuesday
  Most active hour: 2-3 PM
  Commits this week: 23

blame

Show who changed each line of a file.
wit blame <file>

Examples

wit blame src/index.ts

Example Output

a1b2c3d4 (Alice  2024-01-15) import { Repository } from './core';
e5f6g7h8 (Bob    2024-01-10) import { Logger } from './utils';
a1b2c3d4 (Alice  2024-01-15) 
i9j0k1l2 (Alice  2024-01-12) export function main() {
e5f6g7h8 (Bob    2024-01-10)   const logger = new Logger();
i9j0k1l2 (Alice  2024-01-12)   const repo = Repository.open('.');

Quick Productivity Workflow

# Working on something, need to switch contexts fast
wit wip -a  # Quick save

# Switch to handle something else
wit switch other-branch

# Come back later
wit switch -
wit uncommit  # Restore WIP state

# Before doing something risky
wit snapshot create "known good state"

# Try something risky...

# Didn't work? Restore!
wit snapshot restore "known good state"

# Done with feature, clean up
wit cleanup --dry-run
wit cleanup