Setup
git has no account config. It needs an existing repository to inspect, or
a writable mount on which to initialize or clone one.
Supported commands
Rungit <command> --help for the supported flags and operands.
This list is generated from Mirage’s registered command tree.
Create and inspect a repository
-C selects a workspace directory and defaults to the session’s working
directory. Repository discovery walks upward, so commands also work from
subdirectories. Loose objects, packs, refs, the index and working files all
use the same VFS operations as the shell.
init supports -b, --bare and reinitialization. The default branch is
master unless -b chooses another. commit requires -m and records
mirage <mirage@localhost> unless --author 'Name <email>' overrides it.
fsck checks the object database without modifying it.
Stage and change files
Continue from the initial commit above. Record a second version before usingHEAD~1 to restore the original:
restore can discard changes in the selected destination. Use -- before a
path beginning with -. Permission and read-only refusals go through the
workspace dispatcher and are reported in Git’s command-specific wording.
Branches, tags and history
-m; lightweight tags can point to any object. Revision
expressions include parent/ancestor operators (^, ~), typed peels such as
HEAD^{tree}, and paths such as HEAD:hello.txt. Operators apply left to
right. Invalid suffixes are refused as part of the whole revision.
log, show, rev-list, diff-tree, shortlog, cat-file, hash-object
and ls-tree provide inspection without a host Git process. Run each command’s
--help for supported formatting, filtering, path and diff options.
Clone, fetch and repository configuration
checkout, switch, restore and
reset as git refuses it; git clone then exits 128 and keeps the repository
with an empty work tree. Reading the entries of a tree that holds an entry with
an empty name exits 128 with git’s empty filename in tree entry.
For authenticated GitHub clones, gh repo clone supplies its configured token,
and only to its configured GitHub origin.
--git-dir and --work-tree override GIT_DIR and GIT_WORK_TREE and resolve
against -C. Repository core.worktree and core.bare affect discovery;
linked worktrees use their recorded layout. Working-tree commands refuse bare
repositories. No repository operation opens a host path behind the VFS.
Limits and intentional differences
- Only the listed command subset is implemented. Merge, rebase, push, pull,
reset --hardandswitch -are absent; stash supports inspection only. - Commits accept no path operands and do not create merge commits. An unmerged
index blocks commits and branch moves.
checkoutis stricter than Git about staged changes;switchcan carry compatible staged changes but refuses file/directory collisions that would discard them. - Host templates, hooks, editors and Git’s initial-branch advisory are absent.
Per-worktree
config.worktreeis not read. With conflictingcore.bareandcore.worktree, Mirage keeps the repository bare without Git’s warning. - Working-tree replacements preserve executable modes and symlink semantics. They do not follow a symlink out of a directory being replaced. Nested mounts block removals or replacements that would consume their contents; destinations are checked before writes begin. Renames preserve namespace metadata and cannot cross mount boundaries at either end.
- Gitlinks create or retain directory placeholders. Mirage does not check out submodule content or compare a submodule’s HEAD; files inside a submodule directory can still appear as untracked. Removing a nonempty gitlink directory warns and leaves it in place.
- Diff hunk bodies and diffstat counts can differ from native Git because
the line-diff algorithm differs from xdiff. Headers, ordering and supported
formatting match Git. Pretty formats
email,mboxrdandreferenceare refused. - History searches use ASCII case folding.
--sinceand--untilaccept ISO-8601 or epoch seconds; relative date phrases are refused. tag -l/-dconflict wording uses a fixed option order. Tag deletion uses a ref transaction: duplicate updates are refused atomically, while missing names are reported and skipped.
git does not make a read-only mount writable.
Upstream and dependency licenses
Dulwich offers an Apache-2.0 option; using it does not require choosing its
GPL alternative. Matching Git behavior does not relicense Git, Dulwich or
isomorphic-git. Copied or ported source and redistributed dependencies still
carry their applicable terms and notices; see
compatibility and licenses.