无法通过 HTTP 推送 git 存储库
我位于仅允许 HTTP/HTTPS 的防火墙后面。虽然我可以通过 HTTPS 拉取 git 存储库,但无法通过 HTTP/HTTPS 推送它们。尽管该存储库托管在 github 上,这允许这样做,但我收到错误。这是我得到的错误:
user@ubuntu:~/crazykdeme/mirrored/news$ git push -u origin master
XML error: not well-formed (invalid token)
error: no DAV locking support on https://github.com/mynick/news.git/
fatal: git-http-push failed
I am behind a firewall that allows only HTTP/HTTPS. Although I am able to pull git repos via HTTPS, I am unable to push them via HTTP/HTTPS. Though the repo is hosted on github, which allows this, I get an error. Here is the error that I get:
user@ubuntu:~/crazykdeme/mirrored/news$ git push -u origin master
XML error: not well-formed (invalid token)
error: no DAV locking support on https://github.com/mynick/news.git/
fatal: git-http-push failed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
2012 年:我成功地使用 https 地址在代理后面推送到 GitHub。
但是,您需要 Git 1.6.6+ 才能支持 smart-http 协议:
请参阅“无法使用 http 将 Git 推送到远程存储库/https”了解更多信息,以及“Git Push over HTTP 不激活远程挂钩" smart http的总体思路和优势。
要了解您需要设置的所有变量,以便 thyat 推送成功:
请参阅“无法在 git 上获取 Http” :
http_proxy
https_proxy
http.sslcainfo
$HOME/.netrc
(或 Windows 上的%HOME%/_netrc
)2023:不要忘记,自 2021 年 8 月起,基于令牌的身份验证(例如,个人访问、OAuth、SSH 密钥或 GitHub 应用程序)所有经过身份验证的 Git 操作都需要安装令牌。
因此,请确保使用 PAT(个人访问令牌) 作为密码。
2012: I manage to push just fine to GitHub behind proxy, with an https address.
However, you need a Git 1.6.6+ in order to support the smart-http protocol:
See "Cannot push Git to remote repository with http/https" for more, and "Git push over HTTP not activating remote hooks" for the general idea and advantage of smart http.
To know all the variables you need to setup in order for thyat push to success:
See "Cannot get Http on git to work":
http_proxy
https_proxy
http.sslcainfo
$HOME/.netrc
(or%HOME%/_netrc
on Windows)2023: Do not forget that, since Aug. 2021, token-based authentication (for example, personal access, OAuth, SSH Key, or GitHub App installation token) will be required for all authenticated Git operations.
So make sure to use a PAT (Personal Access Token) as password.
如果您启用了双因素身份验证 (2FA),请检查您的个人访问令牌的有效性。由于个人访问令牌用于通过 HTTP 对 Git 进行身份验证。
If you you have Two-Factor Authentication (2FA) enabled, check your personal access token's validity. As personal access tokens are used to authenticate against Git over HTTP.
检查您正在推送的存储库中是否有某种 VPN 或额外的安全性,就我而言,它位于 gitlab 中并具有一些公司安全设置,并且在我能够访问之后我必须激活相同的 VPN存储库并进行推送
Check if you have some kind of vpn or extra security in the repository that you are pushing, in my case it was in gitlab and had some company security settings, and I had to activate the vpn of the same after that I was able to access the repository and make the push