Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why my git is not updating from 1.7.1 to 1.9.4

Tags:

git

I am on REDHAT 6. I want to update my git, I tried multiple ways.

1st Method

$yum update git. I got : No Packages marked for Update.

2nd Method

$ wget http://git-core.googlecode.com/files/git-1.8.3.4.tar.gz
$ wget -O git-manpages-1.8.3.4.tar.gz http://code.google.com/p/git-core/downloads/detail?name=git-manpages-1.8.3.4.tar.gz&can=2&q=

Next, install all required libraries before building GIT:

$ sudo yum install zlib-devel perl-CPAN gettext

Now let’s untar and build and install GIT in the /usr directory:

$ tar xvfz git-1.8.3.4.tar.gz
$ cd git-1.8.3.4
$ ./configure
$ make
$ sudo make prefix=/usr install
$ git --version
git version 1.8.3.4

Got This error.

[qaserver@qaserver3 ~]$ cd git-1.8.3.4
[qaserver@qaserver3 git-1.8.3.4]$ ./configure
configure: Setting lib to 'lib' (the default)
configure: Will try -pthread then -lpthread to enable POSIX Threads.
configure: CHECKS for site configuration
configure: CHECKS for programs
checking for cc... no
checking for gcc... no
configure: error: in `/home/qaserver/git-1.8.3.4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

3rd Method

Install Required Packages

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

Download and Compile Git Source

# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-1.9.4.tar.gz
# tar xzf git-1.9.4.tar.gz

After downloading and extracting Git source code, Use following command to compile source code

# cd git-1.9.4
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc

All the above command executed successfully without any error, but when i

$ git --version or $ git version

Still I m getting.

git version 1.7.1

I have gone mad, What is wrong with this any body have idea???

like image 666
Varun Avatar asked Jun 29 '15 06:06

Varun


People also ask

How do I update to the latest version of Git?

To update git on Windows, the first possible way is to uninstall the current git version from Windows and install the latest version. However, you can also use Command Prompt to update git on Windows by executing the “git update-git-for-windows” command.

How do I download git update?

Download the installation file from the Git website. Run the installation and follow the install wizard to update Git to the latest version. Note: Using the install wizard to update Git overwrites the current installation.

What is the latest git version for Mac?

Binary installer Tim Harper provides an installer for Git. The latest version is 2.33.0, which was released about 1 year ago, on 2021-08-30.

How do I know if git is installed or not?

To see if Git is installed on your system, open your terminal and type git --version . If your terminal returns a Git version as an output, that confirms you have Git installed on your system.


1 Answers

For RedHat or CentOS, method 3 is the right way to go, just need to remove the pre-existing git before:

yum remove git

After that, your new git will work as expected.

See Install git on on CentOS/Redhat 7/6,5 and Fedora 22/21.

I hope this helps.

like image 135
Eldad Assis Avatar answered Nov 14 '22 20:11

Eldad Assis