Installing Git

Updated

October 30, 2026

Installing Git

After this page you have a current git on your PATH on Linux and can print its version.

Check what you already have

git --version
which -a git

This book wants 2.45 or newer on Linux. Examples were checked against 2.55. You need git switch, git restore, and (later) SSH commit signing.

Most desktop distros already ship a new enough Git. If which git prints /usr/bin/git and the version is 2.45+, you are done.

Install from the distro

Arch Linux and Omarchy

pacman -Q git
# missing or too old:
sudo pacman -S git

Debian and Ubuntu

sudo apt update
sudo apt install git

Fedora

sudo dnf install git

Enterprise images sometimes freeze Git at 2.25. If git --version is older than 2.45, use your distro’s backports or a current tarball from git-scm.com so switch and restore exist.

Line endings and the filesystem

Linux stores LF line endings and executable bits. Leave core.autocrlf unset. Leave core.fileMode at the default (true) so chmod +x is recorded. Those defaults are why hooks and scripts in later chapters work with chmod +x hook.sh.

What else you need for Parts I–II

Tool Role
A Linux terminal Where you run git (bash or another POSIX shell)
A text editor nvim in this book’s config examples; any editor is fine

Docker, Kubernetes, and a forge account wait until later parts.

Set core.editor once you know which editor you type in (next page). Until then, git commit -m "message" avoids opening one.

Confirm

git --version
which git
echo "$HOME"

$HOME should be /home/<you>. Then set identity and the three config layers on the next page.