无法访问 git 存储库
cannot access git reposoitory
知道为什么这不起作用:
D:\apache-tomcat-8.0.33\bin>"C:\Program Files\Git\bin\git.exe" -c core.askpass=true ls-remote -h https://tobias@wdmycloud/shares/githome/Repo.git HEAD
fatal: repository 'https://tobias@wdmycloud/shares/githome/Repo.git/' not found
我可以使用 eclipse 成功克隆这个存储库:
关于 WD MyCloud, you will find tutorial to access a git repo through ssh,这是相当容易设置的,考虑到您只需要一个 sshd 运行。
但是要使 https url 正常工作,您需要 Apache 服务器 运行、properly configured to support git http-backend
。
符合 an httpd.conf
的内容包括:
# Configure Git HTTP Backend
SetEnv GIT_PROJECT_ROOT /www/example.com/git
SetEnv GIT_HTTP_EXPORT_ALL
# Note: Serve static files directly
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/www/git/
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/
# Note: Serve repository objects with Git HTTP backend
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/info/[^/]+ | \
git-(upload|receive)-pack))$" \
/usr/libexec/git-core/git-http-backend/
这不是标准的,除非你事先自己设置。
在 Eclipse 中,您使用的是 SSH,而在命令行中,您使用的是 HTTPS。这是两种不同的协议,一种有效并不一定意味着另一种也有效。请尝试使用 SSH URL:
"C:\Program Files\Git\bin\git.exe" -c core.askpass=true ls-remote -h ssh://tobias@wdmycloud/shares/githome/Repo.git HEAD
知道为什么这不起作用:
D:\apache-tomcat-8.0.33\bin>"C:\Program Files\Git\bin\git.exe" -c core.askpass=true ls-remote -h https://tobias@wdmycloud/shares/githome/Repo.git HEAD
fatal: repository 'https://tobias@wdmycloud/shares/githome/Repo.git/' not found
我可以使用 eclipse 成功克隆这个存储库:
关于 WD MyCloud, you will find tutorial to access a git repo through ssh,这是相当容易设置的,考虑到您只需要一个 sshd 运行。
但是要使 https url 正常工作,您需要 Apache 服务器 运行、properly configured to support git http-backend
。
符合 an httpd.conf
的内容包括:
# Configure Git HTTP Backend
SetEnv GIT_PROJECT_ROOT /www/example.com/git
SetEnv GIT_HTTP_EXPORT_ALL
# Note: Serve static files directly
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/www/git/
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/
# Note: Serve repository objects with Git HTTP backend
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/info/[^/]+ | \
git-(upload|receive)-pack))$" \
/usr/libexec/git-core/git-http-backend/
这不是标准的,除非你事先自己设置。
在 Eclipse 中,您使用的是 SSH,而在命令行中,您使用的是 HTTPS。这是两种不同的协议,一种有效并不一定意味着另一种也有效。请尝试使用 SSH URL:
"C:\Program Files\Git\bin\git.exe" -c core.askpass=true ls-remote -h ssh://tobias@wdmycloud/shares/githome/Repo.git HEAD