Git
$ git Foundation Med RiskThe standard distributed version control system powering modern software repositories. Offers scriptable --porcelain status formats, --no-pager output, and --dry-run on selected write operations, though destructive history commands require strict agent guardrails.
brew install git Keep git as a direct shell CLI: local working-tree inspection, staging, and diffs require sub-millisecond filesystem access that MCP wrappers add latency to.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]
[--no-optional-locks] [--no-advice] [--bare] [--git-dir=<path>]
[--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>]
<command> [<args>]
These are common Git commands used in various situations:
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one
work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
restore Restore working tree files
rm Remove files from the working tree and from the index
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
diff Show changes between commits, commit and working tree, etc
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
grow, mark and tweak your common history
backfill Download missing objects in a partial clone
branch List, create, or delete branches
commit Record changes to the repository
history EXPERIMENTAL: Rewrite history
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
reset Set `HEAD` or the index to a known state
switch Switch branches
tag Create, list, delete or verify tags
collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system. FCRS-1.0 6-Dimension Breakdown
Provides --porcelain=v2, --no-pager, and GIT_TERMINAL_PROMPT=0 for headless scripting, though it lacks universal --json output across subcommands.
- Supports
git status --porcelain=v2andgit --no-pager - Supports
GIT_TERMINAL_PROMPT=0to prevent credential prompt hangs
Offers --dry-run (-n) on commands like git clean and git push, but commands such as git reset --hard can irreversibly discard uncommitted work.
git clean -nandgit push --dry-runpreview side effects- Destructive commands (
reset --hard,push --force) require policy guardrails
Pre-installed or trivially available on macOS, Linux, and Windows with minimal footprint.
- Native packages on all major OSes and CI runners
Indispensable source-control foundation with fine-grained plumbing and porcelain commands for every repo workflow.
- Full local and remote repository lifecycle coverage
Mature foundation-backed project under the Software Freedom Conservancy with continuous security and feature releases.
- Maintained by the Git Project under GPL-2.0
Extensive built-in manpages (git help <cmd>) and official reference documentation.
- Complete command reference at git-scm.com/docs
Security, Auth & Guardrails
Delegates remote auth to git-credential helpers (macOS Keychain, libsecret, Windows Credential Manager), SSH keys, or ~/.git-credentials.
Free and open-source under GPL-2.0 with no runtime service fees.
# Git (git) Agent Rules - Always pass `--no-pager` (or set `GIT_PAGER=cat`) and `GIT_TERMINAL_PROMPT=0` in automation. - Never run `git reset --hard`, `git clean -fd`, or `git push --force` without explicit user approval. - Inspect changes with `git status --porcelain=v2` and `git diff` before staging or committing.
Agent-Ready Command Recipes
Safe Read-Only Queries
git --no-pager status --porcelain=v2 --branch
Emits stable, parseable status and branch tracking lines without launching an interactive pager.
git --no-pager log -n 15 --oneline --no-decorate
Returns concise commit hashes and subjects for fast context gathering.
Controlled Writes & Previews
git clean -nd
Uses -n (--dry-run) to list untracked files and directories that would be deleted before making any changes.
Strengths for Agents
- + Scriptable
--porcelain=v2status and-znull-delimited output handle arbitrary filenames safely. - +
GIT_TERMINAL_PROMPT=0and--no-pagerprevent interactive TTY blocks. - + Available everywhere with zero external runtime setup.
Caveats & Pitfalls
- ! No universal
--jsonoutput flag acrosslog,diff, orbranch. - ! Working-tree destructive commands (
git reset --hard,git clean -fd) can wipe uncommitted agent edits.