Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

MediaGit command-line interface reference documentation.

Command Categories

Core Commands

Essential commands for daily workflows:

  • init - Initialize repository
  • add - Stage files
  • commit - Create commits
  • status - Show working tree status
  • log - Show commit history
  • diff - Show differences
  • show - Show object details

Branch Management

Working with branches:

  • branch - Create, list, delete branches
  • merge - Merge branches
  • rebase - Rebase branches
  • cherry-pick - Apply commits from another branch
  • bisect - Binary search through commit history
  • stash - Stash uncommitted changes
  • reset - Reset current branch to a commit
  • revert - Revert a commit by creating an inverse commit
  • tag - Create and manage tags

Remote Operations

Collaborating with remotes:

  • clone - Clone a remote repository
  • remote - Manage remote repositories
  • fetch - Fetch from remote without merging
  • push - Push changes to remote
  • pull - Fetch and merge from remote

History and Diagnostics

Inspecting repository state:

  • reflog - Show reference log (history of HEAD and branch movements)

Maintenance

Repository maintenance:

  • gc - Garbage collection
  • fsck - File system check
  • verify - Verify object integrity
  • stats - Repository statistics

Global Options

Available for all commands:

  • -C <path> - Run as if started in this directory
  • --help - Show command help
  • --version - Show MediaGit version
  • --verbose, -v - Verbose output
  • --quiet, -q - Suppress output
  • --color <when> - Colorize output (auto/always/never)

Environment Variables

  • MEDIAGIT_REPO - Repository root path (set automatically by -C)
  • MEDIAGIT_AUTHOR_NAME - Author name override
  • MEDIAGIT_AUTHOR_EMAIL - Author email override

See Environment Variables for complete list.