为什么我的git没有从1.7.1更新到1.9.4 [英] Why my git is not updating from 1.7.1 to 1.9.4

查看:145
本文介绍了为什么我的git没有从1.7.1更新到1.9.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在REDHAT 6.
我想更新我的git,我尝试了多种方式。

第一种方法



$ yum update git。
我得到了:没有软件包标记为更新。



第二种方法

  $ 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-manpage-1.8.3.4.tar.gz&can=2&q=

接下来,在构建GIT之前安装所有必需的库:

$ sudo yum install zlib-devel perl-CPAN gettext

现在让我们解压并构建并安装GIT / usr目录:

$ 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

得到此错误。

  [qaserver @ qaserver3〜] $ cd git-1.8.3.4 
[qaserver @ qaserver3 git-1.8.3.4] $ ./configure
configure:将lib设置为'lib'(默认)
configure:将try -pthread然后-lpthread启用POS IX线程。
configure:CHECKS for site配置
configure:检查程序
检查cc ... no
检查gcc ... no
configure:error:in `/home/qaserver/git-1.8.3.4':
configure:error:在$ PATH中找不到可接受的C编译器
查看`config.log'以获取更多详细信息


第三种方法

需要安装包

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

下载并编译Git源代码

 #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

下载并解压Git源代码后,使用以下命令编译源代码

 #cd git-1.9.4 
#make prefix = / usr / local / git al l
#make prefix = / usr / local / git install
#echoexport PATH = $ PATH:/ usr / local / git / bin>> / etc / bashrc
#source / etc / bashrc

任何错误,但当我

  $ git --version或$ git版本



我仍然得到



git version 1.7.1



我已经疯了,这有什么不妥的想法?

解决方案

对于RedHat或CentOS,方法3是正确的选择,只需要在之前删除预先存在的git即可:

  yum remove git 

之后,您的新git将按预期工作。



请参阅在CentOS / Redhat 7 / 6,5和Fedora 22/21上安装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???

解决方案

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.

这篇关于为什么我的git没有从1.7.1更新到1.9.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆