如果在git clone的时候<span static="" image="" smiley="" default="" titter.gif"="" smilieid="9" border="0" alt="" style="overflow-wrap: break-word; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: -apple-system, "SF UI Text", Arial, "ingFang SC“,”Hiragino Sans GB“,”Microsoft YaHei“,”WenQuanYi Micro Hei“,sans-serif,SimHei,SimSun;”>
首先确定/home/git/repositories/gitosis-admin.git/hooks/post-update为可执行即属性为0755 <span static="" image="" smiley="" default="" titter.gif"="" smilieid="9" border="0" alt="" style="overflow-wrap: break-word; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: -apple-system, "SF UI Text", Arial, "ingFang SC“,”Hiragino Sans GB“,”Microsoft YaHei“,”WenQuanYi Micro Hei“,sans-serif,SimHei,SimSun;”>
<br static="" image="" smiley="" default="" titter.gif"="" smilieid="9" border="0" alt="" style="overflow-wrap: break-word; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255); box-sizing: border-box; outline: 0px; word-break: break-all; color: rgb(51, 51, 51); font-family: -apple-system, "SF UI Text", Arial, "ingFang SC“,”Hiragino Sans GB“,”Microsoft YaHei“,”WenQuanYi Micro Hei“,sans-serif,SimHei,SimSun;”><p static="" image="" smiley="" default="" titter.gif"="" smilieid="9" border="0" alt="" style="overflow-wrap: break-word; margin-top: 0px; margin-bottom: 16px; padding: 0px; white-space: normal; background-color: rgb(255, 255, 255); box-sizing: border-box; outline: 0px; color: rgb(79, 79, 79); line-height: 26px; text-align: justify; word-break: break-all; font-family: -apple-system, "SF UI Text", Arial, "ingFang SC“,”Hiragino Sans GB“,”Microsoft YaHei“,”WenQuanYi Micro Hei“,sans-serif,SimHei,SimSun;”> #make prefix = / usr / local all
#make prefix = / usr / local install#根运行用户
如果编译时提示错误:
LINK GIT-凭证店内
libgit.a(utf8.o):在功能`reencode_string_iconv ':
/opt/git-master/utf8.c:530:未定义参考`libiconv的'
libgit .a(utf8.o):在函数`
reencode_string_len '中:/opt/git-master/utf8.c:569:对`libiconv_open'/
opt/git-master/utf8.c:588的未定义引用:未定义引用` libiconv_close'/
opt/git-master/utf8.c:582:未定义引用`libiconv_open'colle2
: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 && make && 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
<div static="" image="" smiley="" default="" titter.gif"="" smilieid="9" border="0" alt="" style="overflow-wrap: break-word; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255); box-sizing: border-box; outline: 0px; word-break: break-all; color: rgb(51, 51, 51); font-family: -apple-system, "SF UI Text", Arial, "ingFang SC“,”Hiragino Sans GB“,”Microsoft YaHei“,”WenQuanYi Micro Hei“,sans-serif,SimHei,SimSun;”>
三
!@!#!@ 遇到 的问题ERROR:gitosis.serve.main:Repository read access denied
原因:gitosis.conf中的成员与keydir中的用户名不一致,如gitosis中的成员= Macbook @ sth,但keydir中的公密名却叫Macbook.pub
解决:使keydir的名称与gitosis中成员所指的名称一致。改为members = Macbook或公密名称改为Macbook@sth.pub
四
make prefix = / usr / local / git all make prefix = / usr / local / git install |
-------------------
如果编译时提示错误:
LINK git-credential-store
libgit.a(utf8.o):在函数`reencode_string_ iconv '中:
/ opt / git-master / utf8.c:530: 未定义 引用`libiconv'libgit.a
(utf8.o):在函数`
reencode_string_len '中:/opt/git-master/utf8.c:569:未定义引用`libiconv_open'
/opt/git-master/utf8.c:588:未定义引用`libiconv_close'/
opt/git-master/utf8.c:582:未定义引用`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 && make && sudo make install |
然后回到混帐继续编译:
代码如下 | 复制代码 |
cd /usr/local/src/git-1.8.5 make configure ./configure --prefix = / usr / local -with-iconv = / usr / local / libiconv make make install |
此时,混帐应该编译安装成功了,可以测试下:
代码如下 | 复制代码 |
cd / usr / local / bin ./git -version git version 1.8.5 |
可能你会发现为什么直接在命令行输入git却提示无效呢,这里还需要做点设置,编辑/ etc / profile,将/ usr / local / bin加入到系统路径:
代码如下 | 复制代码 |
export PATH = $ PATH:/ usr / local / bin |
保存退出,再刷新一下系统路径:
代码如下 | 复制代码 |
源/ etc / profile |
在终端直接输入git --version
如能正确显示版本,git version 1.8.5,则大功告成
。-------------------
3,安装gitosis
代码如下 | 复制代码 |
yum安装 python python-setuptools cd / usr / local / src |
-------------------
如果安装时报错如下:
Traceback(最近一次调用最后一次):从setuptools导入的
<module>中的文件“setup.py”,第2行
setup,find_packages
ImportError:没有名为setuptools的模块
解决方法:
代码如下 | 复制代码 |
cd / usr / local / src wget http://python-distribute.org/distribute_setup.py python distribute_setup.py |
然后再运行
代码如下 | 复制代码 |
python setup.py安装 |
如果显示完成gitosis的处理依赖关系== 0.2表示安装成功
-------------------
原创文章,转载请标明出处!