托管 git 存储库,无法克隆:ssh 错误:文件号错误
我遵循了本教程:http://www.jeremyskinner.co.uk/2010/07/31/hosting-a-git-server-under-apache-on-windows/ 在 Windows 服务器上托管 git 存储库
步骤: 安装 git 和创建测试存储库 安装 Apache(我使用的是 wamp 服务器,它是在 git 之前安装的) 编辑 httpd.conf,添加:
<Directory />
Allow from all
</Directory>
SetEnv GIT_PROJECT_ROOT C:/wamp/www/repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
"C:/Program Files/Git/libexec/git-core/git-http-backend.exe/$1"
我知道这相当不安全,但我只是想先让基础知识发挥作用 所以我重新启动阿帕奇 然后我尝试使用以下命令从台式计算机克隆存储库:
git clone xxx.xxx.xxx.xxx:xxxx/repositories/Test.git
输出是:
Cloning into Test...
ssh: connect to host smarttelecom.no-ip.org port 22: Bad file number
fatal: The remote end hung up unexpectedly
我做错了什么?
I followed this tutorial :http://www.jeremyskinner.co.uk/2010/07/31/hosting-a-git-server-under-apache-on-windows/
to host a git repository on a windows server
steps:
install git & create a test repository
install Apache (I'm using wamp server and it was installed before git)
edit httpd.conf, add:
<Directory />
Allow from all
</Directory>
SetEnv GIT_PROJECT_ROOT C:/wamp/www/repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
"C:/Program Files/Git/libexec/git-core/git-http-backend.exe/$1"
i know this is rather unsafe, but i'm just triing to get the basics working first
so i restart apache
and then i try to clone the repository from a desktop computer with the command:
git clone xxx.xxx.xxx.xxx:xxxx/repositories/Test.git
and the output is:
Cloning into Test...
ssh: connect to host smarttelecom.no-ip.org port 22: Bad file number
fatal: The remote end hung up unexpectedly
what did I do wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用 HTTP 端口。默认情况下,git 使用您不想要的 ssh。尝试在 url 中添加
http://
前缀You have to use the HTTP portocol. By default git uses ssh which you don't want. Try to prefix the url with
http://