Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git,致命:远程端意外挂起_Git_Github - Fatal编程技术网

Git,致命:远程端意外挂起

Git,致命:远程端意外挂起,git,github,Git,Github,当我试着跑的时候 git push origin master --force 我刚得到 Counting objects: 2649, done. Delta compression using up to 2 threads. Compressing objects: 100% (1280/1280), done. error: RPC failed; result=22, HTTP code = 413 | 116 KiB/s fatal: The remote end hung

当我试着跑的时候

git push origin master --force
我刚得到

Counting objects: 2649, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1280/1280), done.
error: RPC failed; result=22, HTTP code = 413 | 116 KiB/s   
fatal: The remote end hung up unexpectedly
Writing objects: 100% (2504/2504), 449.61 MiB | 4.19 MiB/s, done.
Total 2504 (delta 1309), reused 2242 (delta 1216)
fatal: The remote end hung up unexpectedly
Everything up-to-date
这与不安全有关吗?我尝试创建一个公钥,如答案中所示,并再次运行它,但仍然不起作用。我不是在用钥匙吗?如果是,我该如何使用它?

这看起来类似于。 可能值得尝试从http协议切换到ssh:

$ git remote add origin git@github.com:username/project.git

问题是由于git/https缓冲区设置。 为了解决这个问题(摘自)


然后再次运行该命令

原因:已超过Git的默认文件发布大小

解决方案:

导航到回购

导航到存储库后,运行以下命令将缓冲区增加到500MB:

git config http.postBuffer 524288000

在我们的例子中,问题是一个克隆编写了一个
.git/config
文件,其中包含一个只读访问方法的url条目。将url从
://
方法更改为
@
方法修复了该问题


运行
git remote-v
说明了一些问题。

此错误也可能是由于存储库上缺少写入权限而引发的


我的具体案例是这样的:

  • 我使用服务器的
    root
    用户创建了一个repo(通过SSH)
  • 我安装并创建了一个
    git
    linux用户,该用户应该管理所有与git相关的操作
  • 那时,我已经忘记了repo最初是由
    root
    用户创建的,而
    git
    用户根本没有将任何内容写入存储库的文件权限

  • 我在拉的时候碰巧也犯了同样的错误。
    我已经完成了“http.postBuffer”技巧。它解决了这个问题,但当我想推的时候,我又遇到了错误

    是什么解决了我的问题:
    1.使用其他虚拟机将其克隆到其他文件夹。(Linux)。
    2.我已经做了更改。

    3.用我最初无法推送的原始虚拟机推送它。(Windows)

    当我在.ssh中有不正确的密钥对时,我得到了这个错误。将pubkey添加到github(在设置中)为我解决了这个问题。

    如果您正在使用git for windows(如果您是在windows计算机上执行此操作,则很可能是这样),并且此处的其他修复程序都不适用于您,请尝试转到,并获取版本2.4.5或更高版本。为我修复了它。

    您可能在现有的存储库中克隆了存储库,要解决此问题,只需在另一个目录中克隆存储库,并将更改复制到此新目录,然后运行推送。

    我也有同样的问题。我从git网页上注意到,SSH克隆URL具有以下结构:

    git@github.com:user/project.git
    
    我只需更改“/”即可解决我的问题,如下所示:

    git@github.com/user/project.git
    

    这可能会有帮助。

    您可能会遇到这样的错误

    错误:无法锁定配置文件。git/config:没有此类文件或 目录

    这是因为您没有本地
    .git/config
    文件,您可以通过此命令使其工作


    git config--global http.postBuffer 524288000

    我使用git Shell解决了这个问题

    github.com中的每个存储库都为您提供了HTTPS/SSH/Subversion URL,您可以使用该URL使用Shell进行下载,请参见此处:。
    基于GitHub最近的变化,SSH似乎是最好的方法

    要在Shell中使用的命令:

    git clone "URL of repo goes here w/ no quotes"
    

    另外,由于我以不同的方式遇到了这个错误,谷歌把我带到了这里

    我的问题是案例不匹配;一只骆驼和一只骆驼不一样。显然,GIT不告诉你为什么就阻止你这么做。因此,如果您的分支与远程分支仅在大小写上不同,请尝试将它们更改为相同

    见:

    当我错写了我的远程分支名称时,我遇到了这个错误。与其他答案相反,我在使用ssh推送时遇到了问题。我切换到https,问题得到了解决

    git remote remove origin
    git remote add origin https://github.com/user/repo
    git push --set-upstream origin master
    

    添加一个答案似乎几乎毫无意义,但当我最终发现Visual Studio Online偶尔出现故障时,我已经为此奋斗了很久。这一点在VS不断提示征信和VSO网站有时给出500分时变得显而易见

    Counting objects: 138816, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (38049/38049), done.
    error: unable to rewind rpc post data - try increasing http.postBuffer
    error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
    The remote end hung up unexpectedly/138816), 33.30 MiB | 3.00 KiB/s
    Writing objects: 100% (138816/138816), 50.21 MiB | 3.00 KiB/s, done.
    Total 138816 (delta 100197), reused 134574 (delta 96515)
    fatal: The remote end hung up unexpectedly
    Everything up-to-date
    

    后来我将HTTP post缓冲区设置回2MB,因为我实际上认为它对许多较小的post更有效。

    其他解决方案在我的情况下不起作用,执行垃圾收集为我修复了它:

    git-gc——攻击性

    (你可以试一下
    git gc

    首先)

    这可能在更新OSX平台后发生


    打开Terminal并导航到您的.ssh文件夹,然后输入
    ssh add-K~/.ssh/id\u rsa

    这似乎是千真万确的事情之一


    对我来说,我最初是通过SourceTree推动master和develop(master没有任何更改)。将此更改为仅开发有效。

    执行此操作可查看您正在使用的密钥; ssh-vTgit@github.digitalglobe.com

    然后确保在您的构建中一开始就运行了这个。 eval“$(ssh代理-s)”
    ssh add ~/.ssh/id_rsa

    我在上传大型repo时遇到了类似的错误,“致命:远程端意外挂断”,没有任何进一步的细节

    经过大量研究,以下是我所做的:

    • 使用SSH而不是HTTPS并不能解决问题
    • 将http.postBuffer增量增加到非常大的值,仍然没有 运气
    • 我发现这可能是因为文件太大了 回购协议(因为这是从perforce新移植的回购协议),所以我使用LFS重新创建了回购协议,将largeFileThreshold设置为40m,这大大减少了回购协议的规模(从3.5G减少到500M)。 我原以为这会解决问题,但令我惊讶的是,我仍然面临同样的错误
    最后,我想到可能是我使用的是一个较旧的git客户端,因为我没有看到其他错误消息。 我将git客户端升级到最新版本(2.20.1),瞧,错误消失了

    PL
    Counting objects: 138816, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (38049/38049), done.
    error: unable to rewind rpc post data - try increasing http.postBuffer
    error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
    The remote end hung up unexpectedly/138816), 33.30 MiB | 3.00 KiB/s
    Writing objects: 100% (138816/138816), 50.21 MiB | 3.00 KiB/s, done.
    Total 138816 (delta 100197), reused 134574 (delta 96515)
    fatal: The remote end hung up unexpectedly
    Everything up-to-date
    
    git config --global http.postBuffer 157286400
    
    set GIT_CURL_VERBOSE=1 set GIT_TRACE=1 
    
    git push 
    -> fatal: The current branch feature/my-new-feature has no upstream branch.
    To push the current branch and set the remote as upstream
    
    git push --set-upstream origin feature/my-new-feature
    
    git config --global http.postBuffer 157286400
    
    Host your-gitlab-server.com
      ServerAliveInterval 60
      ServerAliveCountMax 5
      IPQoS throughput
    
    git config http.postBuffer 2147483648
    
    git clone -c http.postBuffer=2147483648 git@github.com:myuser/myrepo.git /path/to/myrepo
    
    git repack --max-pack-size=100M -a -d
    
    set GIT_TRACE=1
    set GIT_CURL_VERBOSE=1
    git push origin <branch>