Compile and install Git from source in your directory. Approximately as described in https://github.com/git/git/blob/master/INSTALL. In my environment, there was an error around expat and compiling doc, so I installed it in an alternative way.
#Source download $ curl -LO https://github.com/git/git/archive/v2.26.0.tar.gz #Expand and move to the deployment destination $ tar -xvf v2.26.0.tar.gz $ cd git-2.26.0/ #Create a configure file and configure. The installation destination is the extracted directory $ make configure $ ./configure --prefix=$(pwd) #make and install $ make all $ make install #Check the version of installed git. $ bin/git --version git version 2.26.0