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

Synopsis

git unpack-objects [-r] [-q] < <pack-file>

Description

The git unpack-objects command reads a packfile from stdin and writes its contents as individual loose objects into the object database. This is the inverse of git pack-objects.

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

Synopsis

git pack-objects [--stdout] [--all] <base-name> < <object-list>

Description

The git pack-objects command compresses a set of objects into a single packfile, applying delta compression to similar objects. Packs are how Git stores objects efficiently on disk and over the network — every fetch and push transfers packs.

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

Synopsis

git symbolic-ref [--short] <name> [<ref>]
git symbolic-ref --delete <name>

Description

The git symbolic-ref command manipulates symbolic refs — refs that point at another ref instead of a commit. The most familiar example is HEAD: when you're on branch main, HEAD is a symbolic ref pointing at refs/heads/main. Other examples include the default branch indicator on remotes (refs/remotes/origin/HEAD).

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

Synopsis

git update-ref [-d] [--create-reflog] <ref> <newvalue> [<oldvalue>]

Description

The git update-ref command writes a new SHA to a ref atomically. With an optional expected old value, it provides compare-and-swap semantics for safety. It is what porcelain commands like git commit and git branch use under the hood, and what scripts that manipulate refs directly should use instead of editing files in .git/refs/.

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

Synopsis

git for-each-ref [--format=<fmt>] [--sort=<key>] [<pattern>...]

Description

The git for-each-ref command iterates over every ref (branches, tags, remotes, notes, stash) and applies a customizable format. It is far more powerful than parsing git branch or git tag output: you can sort by version, by date, or by any field, and produce stable machine-readable output.

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

Synopsis

git rev-list [<options>] <commit>...

Description

The git rev-list command emits the SHAs of commits reachable from one or more starting points, optionally excluding others. It is the workhorse behind git log, git bisect, and many other commands. With its many filters, it can answer "how many commits between A and B," "the SHA of the merge base," "all commits not on main," and so on.

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

Synopsis

git rev-parse [<options>] <arg>...

Description

The git rev-parse command resolves Git references and arguments. It turns symbolic names (branches, tags, HEAD~3, HEAD@{yesterday}) into 40-character SHAs, normalizes options, and answers introspection questions about the current repository (top-level path, Git directory, whether we're in a worktree). It is the Swiss Army knife of Git scripting.

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

Synopsis

git ls-files [-c] [-d] [-m] [-o] [-i] [--exclude-standard]

Description

The git ls-files command lists files known to Git's index (and optionally the working tree). It supports filters: cached/staged, deleted, modified, others (untracked), ignored, unmerged, and so on. It is faster and more precise than find for "show me all tracked files."

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

Synopsis

git ls-tree [-r] [-d] [-l] [--name-only] <tree-ish> [<path>...]

Description

The git ls-tree command lists entries (mode, type, SHA, name) of a tree object. With -r it recurses into subdirectories. It is the plumbing equivalent of ls on a Git tree. Output is one entry per line, suitable for piping into other tools.

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

Synopsis

git hash-object [-t <type>] [-w] [--stdin] [<file>...]

Description

The git hash-object command computes the SHA-1 (or SHA-256, in modern repos) that Git would assign to a file's contents. With -w, it also writes the object into the object database, returning the SHA. This is the lowest-level mechanism behind git add: that porcelain command essentially calls hash-object -w and then updates the index.