Debian 12 (Bookworm) ships git 2.39.2 from the main repository. git 2.43+ is available via Debian backports. git 2.39 supports all modern features (switch, restore, init.defaultBranch, sparse-checkout cone mode, SSH signing) — backports are only needed for features introduced after 2.39.
Workarounds & Fixes
Enable backports: add `deb http://deb.debian.org/debian bookworm-backports main` to /etc/apt/sources.list
`sudo apt -t bookworm-backports install git`
For most use cases, git 2.39.2 (the default) is sufficient