本文轉自互聯網
以前一直用的svn,對git一點都不熟悉,最近在弄一個php項目,因為項目放在網絡上的coding.net 上,因此想寫個腳本用git直接發布,比較快捷安全。剛開始項目跑在Debain系統上的,使用git 直接發布是沒有問題的,后來因為我的到來,趕上擴容,我對Centos/RedHat比較熟悉,於是就建議把項目遷移到CentOS 系統上,維護起來比較順手。遷移時,遇到了第一個問題就是git不能用了。
錯誤如下:
1
2
|
[root@localhost opt]# git clone https://git.coding.net/XXXXX/XXXXX.git
error: The requested URL returned error:
400
Bad Request while accessing https://git.coding.net/linghuyong/youyiche.git/info/refsfatal: HTTP request failed
|
當時我就蒙了,系統自帶的git不能用,於是在網上巴拉巴拉了半天,有人說是git版本問題,燃后我就整了個2.4.8的版本開始編譯安裝,(centos自帶的版本貌似是1.多的)
1
2
3
4
5
6
7
8
|
yum -y
install
vim gcc-c++ gcc
make
openssl-devel openssl
rpm -e git perl-Git
wget https:
//www
.kernel.org
/pub/software/scm/git/git-2
.4.8.
tar
.gz
tar
xf git-2.4.8.
tar
.gz
cd
git-2.4.8
.
/configure
--prefix=
/usr/local/git
--with-curl --with-expat
make
make
install
|
編譯過程如還需要其他依賴,請自行解決。
哦,記得加環境變量PATH,讓你在bash里面可以直接使用git 命令、怎么加自己弄。
經過了一下會,終於安裝上了,很開心,以為可以用了,是的,沒錯,確實可以用了,但是發現在使用man 的時候,沒有manpage ,於是又百度java培訓機構排名,哈哈找到了
聽說下載一個放進去就好了。
下載地址很多
1
2
3
4
|
https:
//code
.google.com
/p/git-core/downloads/list
git:
//git
.kernel.org
/pub/scm/docs/man-pages/man-pages
.git
https:
//git
.kernel.org
/pub/scm/docs/man-pages/man-pages
.git
https:
//kernel
.googlesource.com
/pub/scm/docs/man-pages/man-pages
.git
|
我選擇了第一個鏈接,
直接在root目錄
1
2
|
wget https:
//git-core
.googlecode.com
/files/git-manpages-1
.9.0.
tar
.gz
tar
xf git-manpages-1.9.0.
tar
.gz
|
說到這,我先說下,我用的是xmanager,這個蠻好用的,並且我登錄的方式是key,pub_key的方式,
我准備重新開個窗口,問題來了,腿都軟了,差掉尿出來,哈哈,開個玩笑!
這個時候ssh 怎么也上不去了。納悶啊,糾結啊,我沒有做任何不正當操作啊,並且,只執行了以上幾條命令啊,同時我也開啟了xshell的log功能,沒有做任何危險操作啊,趕快跑去問老大能不能上。老大也上不去了,這下,真的要尿了,,,,,
經過了半個小時的掙扎,糾結,問題最終解決,但是至今不知道上面原因,
我把神奇問題留在下面,你有么有看出來?這是什么原因?
1
2
3
4
5
6
7
|
[root@localhost~]
# ll /root/ -d
dr-xr-x---. 13 root root 4096 Nov 30 16:18
/root/
[root@localhost~]
#
[root@localhost~]
#
[root@localhost~]
# tar xf git-manpages-1.9.0.tar.gz
[root@localhost~]
# ll /root/ -d
drwxr-x---. 16 110493 5000 4096 Feb 15 2014
/root/
|