CentOs 7.4 安裝git

1.下載git:wget https://github.com/git/git/archive/v2.14.1.ziphtml

 2.安裝依賴:sudo yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMakergit

 

 3.解壓git:unzip v2.14.1.zipgithub

4.將git安裝到/usr/local上bash

先進入git文件夾curl

編譯ui

安裝url

cd git-2.14.1spa

make prefix=/usr/local all.net

make prefix=/usr/local installcode

5.驗證是否安裝完成:git --version

遇到的錯誤:

(1)解壓可能會遇到錯誤:-bash: unzip: command not found ,表示沒有安裝unzip 命令,安裝unzip命令便可:yum install -y unzip zip

(2)但在編譯(make prefix=/usr/local all)這步可能會遇到以下錯誤:

GIT_VERSION = 2.14.1

    * new build flags

    CC credential-store.o

/bin/sh: cc: command not found

make: *** [credential-store.o] Error 127

表示沒有gcc命令,須要先安裝gcc 命令:sudo yum install gcc

(3)原博客中的編譯和安裝步驟須要分開而並非寫在一行,並把<br>換行符號去掉。

cd git-2.14.1<br>make prefix=/usr/local all<br>make prefix=/usr/local install  正確修改:

切換目錄:cd git-2.14.1

編輯:make prefix=/usr/local all

安裝:make prefix=/usr/local install

三個命令須要分開才正確。

 

安裝連接:https://www.cnblogs.com/lonecloud/p/7399804.html

其餘參考連接:

https://blog.csdn.net/youcai35/article/details/51435662/

https://www.cnblogs.com/-colin/p/7160761.html

https://blog.csdn.net/zhuwinmin/article/details/54913468

相關文章
相關標籤/搜索