git-update-server-info 不足以克隆远程仓库?
我想通过 Nginx HTTPS 服务器提供 git 存储库。
我已设置提交后挂钩来运行 git-update-server-info ,以便更新“哑”后端的引用。
通过 HTTPS 接口提取更新工作正常,但是,在最初检查存储库时会失败:
[test@test ttt]$ git clone https://server/git/test.git/
Cloning into thesis...
Username:
Password:
error: The requested URL returned error: 401 (curl_result = 22, http_code = 401, sha1 = 2be2bcc15d1a79eb4e37e03fd2070ee0f229457c)
error: Unable to find 2be2bcc15d1a79eb4e37e03fd2070ee0f229457c under https://test/git/test.git
Cannot obtain needed commit 2be2bcc15d1a79eb4e37e03fd2070ee0f229457c
while processing commit 6c155f7098fd75f23edf71ac5b70b7c22f6070e7.
error: Fetch failed.
在服务器端存储库上手动运行“git update-server-info”并不能解决问题,但运行“git gc”可以解决问题。
但是,“git gc”修复仅在我将更新推送到服务器之前有效,之后整个“git clone”问题再次开始。
在服务器上我运行 git 1.7.1 (来自 Debian backports),在客户端上运行 1.7.2.2 (来自 Arch Linux)
关于如何解决这个问题有任何提示吗?不幸的是,运行“智能”HTTP 后端目前不是一个选项。
I'd like to make a git repository available over a Nginx HTTPS server.
I've set the post-commit hook to run git-update-server-info in order to update the refs for the "dumb" backend.
Pulling updates over the HTTPS interface works fine, however, when initially checking out the repository it fails with:
[test@test ttt]$ git clone https://server/git/test.git/
Cloning into thesis...
Username:
Password:
error: The requested URL returned error: 401 (curl_result = 22, http_code = 401, sha1 = 2be2bcc15d1a79eb4e37e03fd2070ee0f229457c)
error: Unable to find 2be2bcc15d1a79eb4e37e03fd2070ee0f229457c under https://test/git/test.git
Cannot obtain needed commit 2be2bcc15d1a79eb4e37e03fd2070ee0f229457c
while processing commit 6c155f7098fd75f23edf71ac5b70b7c22f6070e7.
error: Fetch failed.
Manually running "git update-server-info" on the server-side repository does not fix the problem, but running "git gc" does.
However, the "git gc" fix only works until I push an update to the server, afterwards the whole "git clone" problem starts again.
On the server I'm running git 1.7.1 (from the Debian backports), on the client I'm running 1.7.2.2 (from Arch Linux)
Any hints on how to solve this problem? Unfortunately running the "smart" HTTP backend is currently not an option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有同样的错误,但在 URL 中包含用户名对我有用:
Had the same error but including the username in the URL works for me:
我这里也有同样的问题,对我来说这似乎是一个错误:虽然 git 要求输入用户名和密码,但它不会将其传递给服务器,因此服务器正确响应 401(未经授权)。
到目前为止我找到的唯一解决方案:正确设置我的 netrc。只需将
msysgit 的 $HOME/.netrc 或 $HOME/_netrc 放入其中,身份验证就会正常完成。
I have the same problem here, it seems like a bug to me: although git asks for username and password, it does not pass it to the server so the server correctly responds with a 401 (not authorized).
Only solution I found so far: setting up my netrc correctly. Simply put
in your $HOME/.netrc or $HOME/_netrc for msysgit, and the authentication will complete normally.
尝试升级您的客户端
http:// /support.github.com/discussions/repos/3829-cloningfetch-fails-for-repo-cannot-obtain-needed-commit
http://support.github.com/discussions/repos/5097-cannt-obtain-commit-while-httpsgithubcomajaxorgacegit-checkout
或者阅读“智能”http:http://progit.org /2010/03/04/smart-http.html
Try upgrading your client
http://support.github.com/discussions/repos/3829-cloningfetch-fails-for-repo-cannot-obtain-needed-commit
http://support.github.com/discussions/repos/5097-cannt-obtain-commit-while-httpsgithubcomajaxorgacegit-checkout
Or maybe read this for "Smart" http: http://progit.org/2010/03/04/smart-http.html