1. 程式人生 > >解決git clone時報錯:The requested URL returned error: 401 Unauthorized while accessing

解決git clone時報錯:The requested URL returned error: 401 Unauthorized while accessing

版本問題,最直接的解決辦法就是重新編輯安裝git吧:

1. 下載:# wget -O git.zip https://github.com/git/git/archive/master.zip

2. 解壓:# unzip git.zip

3. 進入git目錄:# cd git-master

4. 編譯安裝:

# autoconf

# ./configure --prefix=/usr/local

# make && make install

In file included from credential-store.c:1:
cache.h:21:18: warning: zlib.h: No such file or directory


In file included from credential-store.c:1:
cache.h:23: error: expected specifier-qualifier-list before ‘z_stream’

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

============================================================

缺少 zlib的標頭檔案, 開發包沒裝,

yum install zlib (系統預設已經裝上)

yum install zlib-devel 

解決

5. 最後別忘了刪掉舊的git,並把新版本的git建立軟連結到/usr/bin/git

# rm /usr/bin/git

# ln -s /usr/local/bin/git /usr/bin/git