2014-10-16 56 views
0

我有一个webserver apache2,它可以列出我的计算机的/ var/www目录中的文件。 我有两个裸回购repo1.gitrepo2.git。首先是位于/var/www/git/repo1.git,而第二个是一个符号链接:通过http克隆链接到/ var/www的git repo

/var/www/git/repo2.git -> /other/folder/repo2.git 

现在,如果我用网页浏览器http://myserver.com/git/repo1.git去,我可以看到裸露的回购协议的内部文件,如果我去myserver.com/repo1.git我可以看到类似的文件(我也可以在子目录中找到)。

我可以克隆repo1.git通过git clone http://myserver.com/git/repo1.git没有问题。

问题是,当我尝试克隆repo2.git

fatal: repository 'http://myserver.com/git/repo2.git' not found 

其他信息:

我已经启用了钩更新后的两个回购。 我的apache.conf包括以下内容:

<Directory /var/www/git> 
    Options +FollowSymLinks +SymLinksIfOwnerMatch 
    AllowOverride All 
    order allow,deny 
    Allow from all 
</Directory> 

你有问题可能是什么什么想法?

回答

1

恐怕你不能通过http暴露你的文件系统,并希望git工作。

Git内部有一个每个git客户端都可以理解的API,这有助于Git跟踪文件系统以外的元信息。

有一个read here(特别是HTTP部分),你就会知道的步骤顺序是混帐遵循每个操作(克隆,推等)

如果您需要举办自己的Git服务器通过HTTP,我建议像git-webbygitoliteGitlab

如果您的兴趣是学术,this blog将带您通过使用Haskell从头开始实施git克隆。