天天看點

git報錯 gitois報錯

 一 

 如果在git clone的時候遇到

首先确定 /home/git/repositories/gitosis-admin.git/hooks/post-update 為可執行即屬性為 0755

<dl></dl>

<dt>原因</dt>

<dd>公密未找到</dd>

<dt>解決</dt>

<dd>上傳id_rsa.pub到keydir并改為'gitosis帳号.pub'形式,如miao.pub。擴充名.pub不可省略</dd>

<dd>gitosis.conf中的members與keydir中的使用者名不一緻,如gitosis中的members = foo@bar,但keydir中的公密名卻叫foo.pub</dd>

<dd>使keydir的名稱與gitosis中members所指的名稱一緻。 改為members = foo 或 公密名稱改為[email protected]</dd>

<a target="_blank" href="http://blog.haohtml.com/archives/10093">在 centos 裝 git</a>

<a target="_blank" href="http://blog.haohtml.com/archives/9058">在centos 5上安裝git教程</a>

<a target="_blank" href="http://blog.haohtml.com/archives/12697">git中的reversing pushed changes</a>

<a target="_blank" href="http://blog.haohtml.com/archives/13162">ssh+git server on windows – 在windows下搭建git伺服器(教程)</a>

<a target="_blank" href="http://blog.haohtml.com/archives/12256">“remote:error:refusing to update checked out branch:refs/heads/master”的解決辦法</a>

二 

#make prefix=/usr/local all

#make prefix=/usr/local install  #root使用者運作

如果編譯時提示錯誤:

link git-credential-store

libgit.a(utf8.o): in function `reencode_string_iconv’:

/opt/git-master/utf8.c:530: undefined reference to `libiconv’

libgit.a(utf8.o): in function `reencode_string_len’:

/opt/git-master/utf8.c:569: undefined reference to `libiconv_open’

/opt/git-master/utf8.c:588: undefined reference to `libiconv_close’

/opt/git-master/utf8.c:582: undefined reference to `libiconv_open’

collect2: ld 傳回 1

make: *** [git-credential-store] 錯誤 1

解決辦法:

cd /usr/local/src/

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar -zxvf libiconv-1.14.tar.gz

cd libiconv-1.14

./configure -prefix=/usr/local/libiconv  &amp;&amp;  make  &amp;&amp; sudo  make install

然後回到git繼續編譯:

cd /usr/local/src/git-1.8.5

make configure

./configure --prefix=/usr/local -with-iconv=/usr/local/libiconv

make

make install

# git --version

git version 2.2.0

ok,說明安裝成功!

!@!#!@ 遇到的問題

<code>error:gitosis.serve.main:repository read access denied</code>

原因:gitosis.conf中的members與keydir中的使用者名不一緻,如gitosis中的members = macbook@sth,但keydir中的公密名卻叫macbook.pub

解決:使keydir的名稱與gitosis中members所指的名稱一緻。 改為members = macbook 或 公密名稱改為[email protected]

make prefix=/usr/local/git all

make prefix=/usr/local/git install

———————————————————

 代碼如下

複制代碼

./configure –prefix=/usr/local/libiconv  &amp;&amp;  make  &amp;&amp; sudo  make install

./configure –-prefix=/usr/local –with-iconv=/usr/local/libiconv

此時,git應該編譯安裝成功了,可以測試下:

cd /usr/local/bin

./git –version

git version 1.8.5

可能你會發現為什麼直接在指令行輸入git卻提示無效呢,這裡還需要做點設定,編輯/etc/profile, 将/usr/local/bin加入到系統路徑:

export path=$path:/usr/local/bin

儲存退出,再重新整理一下系統路徑:

source /etc/profile

在終端直接輸入 git –-version

如能正确顯示版本,git version 1.8.5,則大功告成。

3、安裝 gitosis

cd /usr/local/src

git clone git://github.com/res0nat0r/gitosis.git

cd gitosis

python setup.py install

如果安裝時報錯如下:

traceback (most recent call last):

file “setup.py“, line 2, in &lt;module&gt;

from setuptools import setup, find_packages

importerror: no module named setuptools

解決方法:

wget http://python-distribute.org/distribute_setup.py

python distribute_setup.py

然後再運作

如果顯示finished processing dependencies for gitosis==0.2  表示安裝成功