Sometimes the answer is 'upgrade'.
Print the installed Git version, optionally with the full set of compile-time options. The first thing to check when a feature 'doesn't work'.
Git's behavior depends not just on version number but on what was compiled in: hash backend (SHA-1 vs SHA-256), TLS library, zlib, curl, and feature toggles. --build-options exposes that surface.
git version [--build-options]
git --version
Prints 'git version X.Y.Z' to stdout. With --build-options, adds CPU,
sizeof-* values, hash backend (sha1: collisiondetect / openssl), and
selected library versions.| Flag | What it does |
|---|---|
--build-options | Append compile-time details: CPU arch, sizeof-long/size_t, sha1/sha256 backend implementations. |
(no args) | Print just the version string. |
git version --build-options first.git switch or git checkout is available.git versiongit version --build-optionsgit --versionver=$(git version | awk '{print $3}'); [ "$(printf '%s\n2.23.0\n' "$ver" | sort -V | head -1)" = "2.23.0" ] || echo 'upgrade git'git --version and git version differ subtly in how Git's option parser handles them, but the output is the same; pick one and stick with it.Hit each option, then Check answers. Score is recorded; Next is always open.