Lion下Git服务器搭建

前面有篇Mountian Lion的Git服务器搭建,这篇是Lion的。从Mountian Lion之后就取消Web Sharing,所有Lion和Mountian Lion有点点区别。

1、googlecode中下载git-1.7.8.4-intel-universal-snow-leopard.dmg
2、双击运行git-1.7.8.4-intel-universal-snow-leopard.pkg
3、可选执行setup git PATH for non-terminal programs.sh
4、打开System Preferences,进入Sharing,并勾选Web Sharing
5、下载Gitbox图形化工具
6、Xcode创建一个工程,并用Gitbox ‘New Reposit‘.(假设这时本地库在/Desktop上,工程名为“GitTest”)
7、运行Terminal,运行命令 git clone --bare -l /Users/yourname/Desktop/GitTest /Users/yourname/Desktop/GitTest.git(实际上x.git为文件夹)
8、将上述文件夹拖入到/Library/WebServer/Documents文件夹下
9、运行命令cd /Library/WebServer/Documents/GitTest.git 和 git update-server-info(后面命令一定要执行)
10、再运行touch git-daemon-export-ok sudo /usr/local/git/libexec/git-core/git-daemon --base-path=/Library/WebServer/Documents/ --syslog --verbose --pid-file=/var/run/git-daemon.pid --user=_www --group=_www --detach --enable=upload-pack --enable=upload-archive --enable=receive-pack  
(base-path参数指出web服务器的Documents目录为git服务器基础目录,git-daemon会扫描该目录下所有尾缀为.git的目录,如果这些目录下有git-daemon-export-ok文件,则将此目录作为git协议的输出repository,用户和用户组都设为_www,与web服务器相同。)
11、最后运行命令sudo chown -R www:www /Library/WebServer/Documents(该步骤是因为不运行chown时,x.git文件夹权限不为_www)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值