This is the way to do it. Run "apt-get build-dep git" to install the build dependencies and the set "--prefix=$HOME/opt" or whatever on the configure script to control where it's installed.
Installing parts of testing or ubuntu can serious mess up your system and have security consequences.
You can also backport the package, it's usually rather easy; you should just need to add a deb-src line for the testing repository to sources.list and then run:
Sidenote: I wonder how far I'd get simplifying the `devscripts` package/dependencies - your instructions will download 200+ megabytes of packages `--no-install-recommends` will do 160.
Side sidenote: https://repo.or.cz/r/git/debian.git/ is listed as Debian's upstream source for git, yet it doesn't use a valid SSL certificate...
Because that's what Linux was missing, a package manager...
Seriously though, if people for whatever reason are content on staying on distributions with ancient packages, something like Guix is far more suited to this problem.