Skip to main content
These commands provide powerful capabilities for advanced workflows.
For stacked diffs, see Stacked Diffs. For history rewriting (cherry-pick, rebase, revert), see History Rewriting. For remote operations, see Remotes. For stash, see Stash. For tags, see Tags. For debugging (bisect, show, clean), see Debugging.

Hooks

Customize behavior at key points in the version control workflow.

Commands

Available Hooks

Examples

Hook Location

Hooks are stored in .wit/hooks/. Edit them to customize behavior:
For more details, see Hooks.

Submodules

Manage nested repositories within your project.

Commands

Examples

For more details, see Submodules.

Worktrees

Work on multiple branches simultaneously with multiple working directories.

Commands

Examples

Use Case

For more details, see Worktrees.

Reflog

View reference history for recovery.

Options

Examples

Example Output

The reflog is what powers wit undo. Every operation is recorded and can be reversed.

Garbage Collection

Clean up and optimize the repository.

Options

Examples

When to Run

  • After deleting many branches
  • After undoing many operations
  • When repository feels slow
  • Before backing up (reduces size)

Monorepo Scopes

Limit operations to specific paths in a monorepo.

Commands

Examples

Effect on Commands

When a scope is set:
For more details, see Monorepo Scopes.

Plumbing Commands

Low-level commands for scripting and advanced use.

hash-object

Calculate the hash of a file.

cat-file

Display contents of an object.

ls-tree

List contents of a tree object.

ls-files

List files in the index.

rev-parse

Parse a revision to its hash.

for-each-ref

Iterate over references.

update-ref

Update a reference.

symbolic-ref

Read or set a symbolic reference.

show-ref

List references.