gitosis在snow lepard下安装小记

来源:互联网 发布:c语言swap什么意思 编辑:程序博客网 时间:2024/06/05 04:25

参考:版本控制之道-使用Git (Progmatic Version Control Using Git)

书中的配置方式应该是针对linux系统的,在mac系统下遇到问题。

一、

11.6 配置Gitosis

 

git clone git@localhost:gitosis-admin.git

出现错误
Initialized empty Git repository in /Users/arthur/study/git/gitosis-admin/.git/
bash: gitosis-serve: command not found
fatal: The remote end hung up unexpectedly
显然是gitosis这个命令不在path中
解决办法:参考 http://lukhnos.org/blog/en/archives/162
这篇文章中没有把gitosis加入path
使用命令 which gitosis-serve 确认路径,返回
/Library/Frameworks/Python.framework/Versions/2.7/bin/gitosis-serve
su - git
vi .bashrc
添加以下内容
PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/git/bin:$PATH

 

二、

添加新版本库出错

git push origin master

error: src refspec master does not match any.

error: failed to push some refs to 'git@localhost:mysite.git'

解决方法:
在工作目录中加一个文件
touch README
git add README 
git commit -m 'first commit'
git push origin master

原创粉丝点击