歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> CentOS安裝GIT(親測ok),centosgit

CentOS安裝GIT(親測ok),centosgit

日期:2017/3/6 9:30:11   编辑:學習Linux

CentOS安裝GIT(親測ok),centosgit


CentOS安裝GIT(親測ok),centosgit


1、安裝所需軟件包 # sudo su # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel # yum install gcc perl-ExtUtils-MakeMaker 2、下載&安裝 # cd /usr/src # wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz(git版本,本文章以2.7.3為准) # tar xzf git-2.7.3.tar.gz # cd git-2.7.3 # 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(此處使用需要用到的用戶下執行,不在必須要root,如果是root用戶那麼只能在root下使用git,其它用戶會有問題) 3、檢查版本 # git --version o、其他 centos自帶Git,7.x版本自帶git 1.8.3.1(應該是,也可能不是),安裝新版本之前需要使用yun remove git卸載(安裝後卸載也可以)。 執行make prefix=/usr/local/git all時,可能會報錯:make: * [git-credential-store] Error 1,此時可以使用以下命令代替 # ./configure --without-iconv # make CFLAGS=-liconv prefix=/usr/local/git all # make CFLAGS=-liconv prefix=/usr/local/git install Important:內容根據網絡以及自己親身體驗整理而成,如果冒犯原創作者,可以聯系QQ:452834144刪除

http://xxxxxx/Linuxjc/1142907.html TechArticle

Copyright © Linux教程網 All Rights Reserved