I downloaded git version 2.9.5 to replace my older version which is 2.7.4.
I downloaded the .gz file from: https://mirrors.edge.kernel.org/pub/software/scm/git/
Turned out as I tried installing that I was missing zlib.h header file, i installed it by issuing the following command:
sudo apt-get install libz-dev
Then I navigated to the newly unzipped git directory again and did all of the following steps:
./configure
make
make install
Everything went smooth and I did not run into any problems, but git --version
still shows:
git version 2.7.4
Why is that the case and how to fix it?
Edit:
Thanks Yaron, the problem has ALMOST been fix. the last step:
make install install-doc install-html
gives me the following error:
"ASCIIDOC git-revert.xml /bin/sh: 2: asciidoc: not found Makefile:334: recipe for target 'git-revert.xml' failed make[1]: * [git-revert.xml] Error 127 make[1]: Leaving directory '/home/omair/git-2.9.5/Documentation' Makefile:2367: recipe for target 'install-doc' failed make: * [install-doc] Error 2"
I have already, as suggested by "https://discourse.gohugo.io/t/solved-asciidoctor-asciidoc-not-found-in-path/10017/2" did these steps
sudo apt-get install asciidoctor
and when that failed,tried:
sudo gem install asciidoctor
still getting the error but the git has now been updated.
update-alternatives --config git
.