cargo install --path .
cargo build --release
./target/release/mug --helpmug initCreates .mug/ directory with:
.mug/db/- Embedded Sled database.mug/objects/- Object storage.mugignore- Default ignore patterns- Default
mainbranch
Repository Operations:
init [path]- Initialize a new repositorystatus- Show working directory statuslog [--oneline]- Show commit historyverify- Verify repository integritygc- Garbage collection
Staging:
add <path>- Stage files (use "." for all)remove <path>- Unstage filesrm <paths...>- Remove and unstage filesmv <from> <to>- Move/rename filesrestore <paths...>- Restore files to HEAD state
Commits:
commit -m <msg> [--author <name>] [-a <author>]- Create commitshow <commit>- Display commit detailsreset [soft|mixed|hard] [commit]- Reset to commit
Branches:
branch <name>- Create branchbranches- List all branchescheckout <branch>- Switch branchmerge <branch>- Merge branch into currentrebase <branch>- Rebase current onto branchrebase -i <branch>- Interactive rebase
Tags:
tag <name> [-m <msg>]- Create tagtags- List all tagsdelete-tag <name>- Delete tag
Stash:
stash [-m <msg>]- Stash changesstash-pop- Apply and remove stashstash-list- List all stashes
Search & Utilities:
grep <pattern>- Parallel search in files (regex support)diff [--from <commit>] [--to <commit>]- Show diff between commits
Commit History Control:
cherry-pick <commit>- Cherry-pick a commitcherry-pick-range <start> <end>- Cherry-pick rangebisect-start- Start bisect sessionbisect-good- Mark current as goodbisect-bad- Mark current as bad
Configuration:
config set <key> <value>- Set config valueconfig get <key>- Get config valueconfig list- List all config
Remote Operations:
remote add <name> <url>- Add remote repositoryremote list- List all remotesremote remove <name>- Remove remoteremote set-default <name>- Set default remoteremote update-url <name> <url>- Change remote URLpush [remote] [branch]- Push to remote (default: origin/main)pull [remote] [branch]- Pull from remote (default: origin/main)fetch [remote]- Fetch from remote without mergingclone <url> [destination]- Clone remote repository
Server Mode:
serve --host <addr> --port <port> --repos <path>- Start HTTP servermigrate <git-repo> <mug-repo>- Migrate from Git
Hooks are stored in .mug/hooks/ and triggered automatically.
Hook Types:
- pre-commit - Runs before creating a commit
- post-commit - Runs after a commit is created
- pre-push - Runs before pushing to remote
- post-push - Runs after pushing to remote
- pre-merge - Runs before merging branches
- post-merge - Runs after merging branches
Create a hook:
echo "cargo fmt" > .mug/hooks/pre-commit
chmod +x .mug/hooks/pre-commitEnable/disable hooks:
mug hook enable pre-commit
mug hook disable pre-commit
mug hook listPattern-based file exclusion using glob patterns.
target/
*.log
.DS_Store
build/
Per-file configuration for merge strategies and attributes.
*.json merge=union
*.txt diff=custom
*.binary binary
Repository-specific configuration.
{
"user.name": "Your Name",
"user.email": "you@example.com"
}mug init
mug config set user.name "Your Name"
mug add .
mug commit -m "Initial commit"mug branch feature/new-feature
mug checkout feature/new-feature
mug add .
mug commit -m "Add feature"
mug checkout main
mug merge feature/new-featuremug rebase -i main
# j/k - navigate
# p/s/r/d - choose actions
# Enter - executemug cherry-pick abc1234
mug cherry-pick-range abc1234 def5678mug bisect-start --bad abc1234 --good def5678
mug bisect-good
mug bisect-badmug stash -m "WIP: feature in progress"
mug checkout other-branch
mug checkout main
mug stash-popmug remote add origin https://example.com/repo.git
mug push origin main
mug pull origin main
mug fetch originmug clone https://example.com/repo.git
mug clone https://example.com/repo.git my-repomug migrate /path/to/git/repo /path/to/mug/repomug keys generate
mug keys import <seed>
mug keys list
mug keys currentmug temporal create backport-v1.0 abc1234
mug temporal list
mug temporal show backport-v1.0
mug temporal merge main backport-v1.0mug store set-server https://store.example.com
mug store set-threshold 10
mug store config
mug store cache-stats
mug store clear-cachemug pack create ./output
mug pack stats ./pack-file.pack
mug pack dedup
mug pack verify ./manifest.jsonNoCommits - No commits have been created yet BranchNotFound - The specified branch does not exist CommitNotFound - The commit ID was not found Conflicts - Working directory has conflicts NotARepository - Not a valid MUG repository Database - Internal database error Custom - Custom error message
Check repository status:
mug statusVerify repository integrity:
mug verifyClean up repository:
mug gcShow reflog:
mug reflogReset to a previous state:
mug reset hard HEAD~1Use parallelized grep for large repositories:
mug grep "pattern"Use shallow clones for large projects:
mug clone --depth 1 <url>Enable compression in pack files:
mug pack create ./outputUse large file storage for binary files:
mug store set-threshold 5Content-addressable blob storage using SHA256 hashes. Objects are automatically deduplicated.
Staging area for changes. Tracked in Sled database under index tree.
Immutable commit objects with full history support. Stored in commits tree.
Named pointers to commits. Stored in branches tree with HEAD management.
Remotes are stored in .mug/config.json with URL validation.
Hooks execute in a subprocess with full stdout/stderr capture.
See generated documentation with:
cargo doc --openSee CONTRIBUTING.md for contribution guidelines.
GNU Lesser General Public License v3.0