Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git cat-file (-t | -s | -p | -e) <object>
git cat-file --batch
git cat-file --batch-check

Description

The git cat-file command is a plumbing tool that reads raw Git objects from the object database. It can print an object's type (blob, tree, commit, tag), size, and content. The --batch mode lets scripts feed many object names on stdin and receive structured output, which is far faster than invoking cat-file per object.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git config --global credential.helper <helper>
git credential fill
git credential approve
git credential reject

Description

The git credential machinery handles authentication for HTTPS remotes. Rather than prompting for a username and password every push, Git delegates to a credential helper that stores credentials securely.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git config [--global | --system | --local] <key> [<value>]
git config --list
git config --edit

Description

The git config command reads and writes Git configuration. Settings live in three layers: system-wide (/etc/gitconfig), per-user (~/.gitconfig or ~/.config/git/config), and per-repository (.git/config). More specific layers override more general ones.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git stash push -p -m <msg> -- <pathspec>
git stash branch <newbranch> [<stash>]
git stash create
git stash store -m <msg> <sha>

Description

Beyond git stash push and git stash pop, the stash machinery offers powerful capabilities for advanced workflows.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git range-diff <range1> <range2>
git range-diff <base> <rev1> <rev2>

Description

The git range-diff command compares two sequences of commits (typically a branch before and after a rebase) and shows what changed between them at the patch level. This is far more useful than a regular git diff for reviewing rebases, because it pairs up corresponding commits and highlights only the substantive differences.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git config --global rerere.enabled true
git rerere status
git rerere diff
git rerere clear

Description

The git rerere command (Reuse Recorded Resolution) records how you resolve a conflict the first time and replays the same resolution automatically the next time the same conflict appears. It is invaluable when long-lived feature branches are repeatedly merged or rebased onto a moving base — without rerere, you re-resolve the same conflicts every time.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git reflog [show] [<ref>]
git reflog expire [--expire=<time>] [--all]
git reflog delete <entry>

Description

The git reflog command shows the history of where each ref (HEAD, branches) has pointed locally. Every move — commit, checkout, reset, rebase — is logged with a timestamp and reason. The reflog is your safety net: even after a "destructive" operation like git reset --hard, the previous state is recoverable for as long as the reflog entry survives (typically 90 days).

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git bundle create <file> <git-rev-list-args>
git bundle verify <file>
git bundle list-heads <file>
git clone <file> <dir>

Description

The git bundle command packages Git history into a single file that can be transferred without a network — by USB drive, email, or any file transport. The recipient can clone or fetch from the bundle as if it were a remote. This is invaluable for air-gapped systems, slow connections, or as a backup format.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git archive [--format=<fmt>] [--prefix=<p>/] [-o <file>] <tree-ish> [<path>...]

Description

The git archive command creates a tar or zip file containing the contents of any tree (commit, tag, or branch). Unlike a simple tar of the working tree, it includes only tracked files at a specific revision and excludes .git directories. This makes it ideal for producing release tarballs, source distributions, and reproducible snapshots.

Par Anonyme (non vérifié) , 29 avril 2026

Synopsis

git notes add [-m <msg>] [<commit>]
git notes show [<commit>]
git notes append [-m <msg>] [<commit>]
git notes remove [<commit>]

Description

The git notes command attaches additional metadata to commits without rewriting them. Notes are stored in their own ref namespace (refs/notes/commits by default) and are displayed alongside commits in git log. Use cases include code review comments, build status, ticket links, or sign-offs added after the fact.