ci: Improvements to default Git versions
This MR improves our tooling around building Git. This also fixes an issue we have where we currently test against the old Git v2.31.0 in CI, whereas we should be testing the newer Git v2.31.1.
Closes #3802 (closed)#
Edited by Patrick Steinhardt