【问题标题】:GIT error while push: error: RPC failed; result=7, HTTP code = 401推送时出现 GIT 错误:错误:RPC 失败;结果 = 7,HTTP 代码 = 401
【发布时间】:2015-07-30 08:54:36
【问题描述】:

当我尝试将一些提交推送到远程服务器时,我得到了这个响应(等待大约 5 分钟后):

git.exe push --progress "origin" events_devel:events_devel

Counting objects: 195, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (47/47), 475.15 KiB | 0 bytes/s, done.
Total 47 (delta 32), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; result=7, HTTP code = 401
Everything up-to-date

我尝试过这个:https://stackoverflow.com/a/6849424,但结果相同。 远程服务器不是 GitHub……它是企业服务器。 拉动正常工作。

【问题讨论】:

  • 您是否在使用公司代理?
  • 是的,我们是 VPN 链接。但正如我所说,拉动是可以的。我忘了写我推送 0.5 MB 文件和其他小源文件。
  • origin 远程使用ssh:// 还是http:// 协议?
  • 托马斯莱维:http://
  • 如果可以,请尝试ssh://,如果可行,那么您知道您必须将精力集中在 http 协议上

标签: git push


【解决方案1】:

稳定的 Git for Windows (1.9.5) 在使用 http 和 windows 或基本身份验证进行更新时存在问题。

尝试升级到 2.4.6-release 候选版本。你可以找到它here

Source

【讨论】:

    【解决方案2】:

    这很可能是远程端的一些网络问题。

    尝试使用不同的协议,例如 ssh。

    要调试问题,您可以为 git 命令指定一些额外的变量,例如

    GIT_TRACE=1 GIT_TRACE_PACK_ACCESS=1 GIT_CURL_VERBOSE=1 GIT_TRACE_CURL=1 GIT_TRACE_PACKET=1 git push --progress origin

    对于 SSH 问题,请尝试:

    echo 'ssh -vvv $*' > ssh && chmod +x ssh
    GIT_SSH="$PWD/ssh" git push --progress origin
    

    或者使用strace调试进程,例如

    strace -f git push
    

    另请参阅:How can I debug git/git-shell related problems?

    【讨论】:

      猜你喜欢
      • 2014-05-17
      • 1970-01-01
      • 2015-06-15
      • 2012-12-03
      • 2014-04-17
      • 1970-01-01
      • 2014-01-17
      • 1970-01-01
      相关资源
      最近更新 更多