linux編譯安裝git

用的centos6.4中自帶的git,版本爲1.7.1,配置好github的sshkey後,clone下來的項目沒法提交,提示:git

fatal: Unable to find remote helper for 'https'

網上查閱後,參照http://stackoverflow.com/questions/8329485/git-clone-fatal-unable-to-find-remote-helper-for-https發現是因爲安裝時少安裝cur-devell模塊的緣由,須要從新編譯安裝。github

因而安裝curl-devel:centos

$ yum install curl-devel
$ # cd to wherever the source for git is
$ cd /usr/local/src/git-1.7.9  
$ ./configure
$ make
$ make install

但make的時候發生警告:ssh

注意:若是機器只安裝了libcurl,而沒有安裝libcurl-devel包,是無法進行編譯的。他們兩個區別是:

libxxx至關於只有動態庫的部分  只能被編譯好的程序運行的時候連接,但缺乏部分頭文件的源代碼,因此不能編譯。若是是編譯爲動態庫,須要libxxx-devel裏邊的頭文件,若是要編 譯爲靜態的則須要裏邊的頭文件和c文件都須要,因此libxxx-devel對要編譯一個程序的時候是必不可少的。看考http://stackoverflow.com/questions/2358801/what-are-devel-packages curl

command not found:curl-config

去/usr/bin目錄和/usr/local/bin等常見目錄尋找後均沒發現,使用locate命令尋找:url

[money@money study]$ locate curl-config
/opt/vagrant/embedded/bin/curl-config
/opt/vagrant/embedded/share/man/man1/curl-config.1

才發現原來我這個版本的是在opt目錄下,因而在/usr/bin目錄下作了個軟連接,而後編譯就經過了。spa

再次執行最上邊的安裝步驟,安裝成功而且上傳沒有出現問題。.net

相關文章
相關標籤/搜索