无法通过 HTTP 推送 git 存储库

发布于 2025-01-05 00:39:31 字数 353 浏览 1 评论 0原文

我位于仅允许 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倾听心声的旋律 2025-01-12 00:39:31

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.

千里故人稀 2025-01-12 00:39:31

如果您启用了双因素身份验证 (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.

一身软味 2025-01-12 00:39:31

检查您正在推送的存储库中是否有某种 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文