By admin , 29 April 2026

Synopsis

git format-patch [<options>] <range>
git format-patch -1 <commit>

Description

The git format-patch command produces one mailbox-formatted patch file per commit in a range, ready to be applied with git am or sent with git send-email. Each patch includes the commit message, author, date, and the diff. Patches are numbered (0001-..., 0002-...) so they apply in order.

By admin , 29 April 2026

Synopsis

git am [--3way] [--abort] [--continue] [--skip] <mbox>...

Description

The git am command applies patches from a mailbox file — the kind produced by git format-patch or generated by emailing a diff. Unlike git apply, which only applies the diff content, git am recreates each patch as a commit, preserving the author, date, message, and other metadata embedded in the email.

By admin , 29 April 2026

Synopsis

git pack-refs [--all] [--no-prune]

Description

The git pack-refs command consolidates many individual ref files (one per branch/tag in .git/refs/) into a single .git/packed-refs file. This is faster on filesystems where opening many small files is slow (older Windows, networked filesystems), and reduces filesystem load for repos with thousands of refs.

By admin , 29 April 2026

Synopsis

git maintenance start
git maintenance run [--task=<task>]
git maintenance stop

Description

The git maintenance command, introduced in Git 2.29, replaces and extends git gc --auto with scheduled, fine-grained maintenance tasks: prefetch, commit-graph generation, loose-object packing, incremental repack, and pack-refs. Running git maintenance start registers a recurring schedule via cron, launchd, systemd, or Task Scheduler depending on platform.

By admin , 29 April 2026

Synopsis

git repack [-a] [-d] [-l] [--depth=<n>] [--window=<n>]

Description

The git repack command repackages the repository's objects, combining multiple packs into one and optionally moving loose objects into packs. It's the primary way Git stays compact. git gc calls repack as part of its work; manual repack exposes finer control over delta search parameters.

By admin , 29 April 2026

Synopsis

git prune [-n] [--expire=<date>]

Description

The git prune command deletes loose objects that aren't reachable from any ref. It is normally invoked indirectly by git gc; running it directly bypasses some of gc's safety checks. The --expire grace period (default 2 weeks) prevents deleting recently created objects that may belong to in-progress operations.

By admin , 29 April 2026

Synopsis

git fsck [--full] [--unreachable] [--dangling] [--lost-found]

Description

The git fsck command validates the integrity of the object database: every commit, tree, blob, and tag is checked for correct hash, valid format, and intact references. It identifies dangling objects (no ref points to them, but they aren't unreachable from a reflog) and unreachable objects (truly orphaned).

By admin , 29 April 2026

Synopsis

git gc [--auto] [--aggressive] [--prune=<date>]

Description

The git gc command runs housekeeping tasks: it packs loose objects, removes unreachable objects past the prune window, packs refs, and updates auxiliary files. Git automatically runs gc --auto after operations that create many loose objects (like a large fetch), so most users never invoke gc manually. Manual invocation is useful after rewriting history, deleting many branches, or to reclaim disk space immediately.

By admin , 29 April 2026

Synopsis

git count-objects [-v] [-H]

Description

The git count-objects command reports how many loose objects and packs the repository has, and how much disk space they consume. With -v, it includes a breakdown of garbage, packs, in-pack objects, and prune-able objects.

By admin , 29 April 2026

Synopsis

git verify-pack [-v] [--stat-only] <pack>.idx

Description

The git verify-pack command checks the integrity of a packfile and its index, verifying SHA-1 checksums and delta chain consistency. With -v, it prints the list of objects in the pack along with type, size, and (for deltas) base information.