2

I have installed chef workstation on centOS 6 using vagrant. My current git version here is 1.7.1

In the git config --list, it is not accepting push.default = simple. How can I update this git version to the latest one through terminal.

Any help is appreciated!

  • Why are you using 6 years old OS? You may use RPMForce repository: akyl.net/how-install-latest-version-git-centos-6x – user996142 Jun 27 '17 at 16:45
  • rpmforge and repoforge are dead in the water. Take a look at my answer... – user34720 Jun 27 '17 at 16:48
  • 1
    @nwildner oops, you are right. Then building from sources (your approach) is correct. – user996142 Jun 27 '17 at 16:51
1

You could enable repoforge repository and install a newer version of it. But, as you can see, this repository is dead:

RepoForge might be outdated. We have no updates since very long time.

Best option is to compile from source. Install the dependencies:

# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker

Remove your git software installed through package manager:

# yum remove git

Download the version you want from here: https://www.kernel.org/pub/software/scm/git/

# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-<version>.tar.gz
# tar xzf git-<version>.gz
# cd git-<version> 
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
  • Hi, for the wget command, I am getting error 404. – Yash Jun 27 '17 at 16:53
  • @Yash open https://www.kernel.org/pub/software/scm/git/ with browser to see list of files – user996142 Jun 27 '17 at 16:55
  • This is because you need to ACCESS the site, select one version(say 1.8.5 for example - kernel.org/pub/software/scm/git/git-1.8.5.tar.gz) and download THE version you want. Some people may not need the "bleeding-edge" version of git – user34720 Jun 27 '17 at 16:55
  • Yes, I installed the 2.8.4 version and it worked. One more question. Do I need to execute all these commands from src folder? – Yash Jun 27 '17 at 17:00
  • No. You can download it and unpack inside your home. This is just to make things in a more organized way. Keep in mind that if you need to remove git is just a matter of accessing this git source folder and type make uninstall so, better keep the house clean :) – user34720 Jun 27 '17 at 17:01
1

Updated GIT version to 2.4.4 on Centos 6.6 Vagrant VM "minimal/centos6"

yum install curl-devel expat-devel libcurl-devel perl-devel asciidoc xmlto xz zlib-devel gettext

curl -kOL https://www.kernel.org/pub/software/scm/git/git-2.4.4.tar.xz

tar xvf git-2.4.4.tar.xz

cd git-2.4.4

make configure

./configure --prefix=/usr

make all

sudo make install install-doc install-html

See https://serverfault.com/questions/448814/yum-doesnt-install-latest-version-of-git-on-centos6/604124#604124

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.