当前位置:   article > 正文

Git提交push报错:HTTP 413 curl 22 The requested URL returned error 413 解决方案(超详细步骤)_http 413 curl 22 the requested url returned error:

http 413 curl 22 the requested url returned error: 413

Git提交push报错:HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large解决方案(超详细步骤)

前言

提交代码push的时候报错:HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large

原因是上传的文件过大,所以会出现以下的错误信息。网上的改法没有用,只能通过使用ssh方式提交才能解决。因此这里给出解决方法。

错误

Total 45 (delta 12), reused 0 (delta 0), pack-reused 0
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
  • 1
  • 2
  • 3
  • 4

解决方法

如果你已经配置好了ssh密钥,可以直接跳到第四步。

1.检查现有 SSH 密钥

在生成 SSH 密钥之前,您可以检查是否有任何现有的 SSH 密钥。

注: DSA 密钥 (SSH-DSS) 不再受支持。 现有密钥将继续运行,但您不能将新的 DSA 密钥添加到您的 GitHub 帐户。

  1. 打开 Git Bash。

  2. 输入 ls -al ~/.ssh 以查看是否存在现有 SSH 密钥:

    $ ls -al ~/.ssh
    # Lists the files in your .ssh directory, if they exist
    
    • 1
    • 2
  3. 检查目录列表以查看是否已经有 SSH 公钥。 默认情况下,公钥的文件名是以下之一:

    • id_rsa.pub
    • id_ecdsa.pub
    • id_ed25519.pub

如果您没有现有的公钥和私钥对,或者不想使用任何可用于连接到 GitHub 的密钥对,则生成新的 SSH 密钥

如果您看到列出的现有公钥和私钥对(例如 id_rsa.pub 和 id_rsa),并且您希望使用它们连接到 GitHub,则可以将 SSH 密钥添加到 ssh-agent

提示:如果您收到错误“~/.ssh 不存在”,不要担心! 我们在生成新的 SSH 密钥时会创建它。

2.生成新 SSH 密钥并添加到 ssh-agent

检查现有 SSH 密钥后,您可以生成新 SSH 密钥以用于身份验证,然后将其添加到 ssh-agent。

如果您还没有 SSH 密钥,则必须生成新 SSH 密钥。 如果您不确定是否已有 SSH 密钥,请检查现有密钥

如果不想在每次使用 SSH 密钥时重新输入密码,您可以将密钥添加到 SSH 代理,让它管理您的 SSH 密钥并记住您的密码。

生成新 SSH 密钥

  1. 打开 Git Bash。

  2. 粘贴下面的文本(替换为您的 GitHub 电子邮件地址)。

    $ ssh-keygen -t ed25519 -C "your_email@example.com"
    
    • 1

    **注:**如果您使用的是不支持 Ed25519 算法的旧系统,请使用以下命令:

    $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    
    • 1

    这将创建以所提供的电子邮件地址为标签的新 SSH 密钥。

    > Generating public/private ed25519 key pair.
    
    • 1
  3. 提示您“Enter a file in which to save the key(输入要保存密钥的文件)”时,按 Enter 键。 这将接受默认文件位置。

    > Enter a file in which to save the key (/c/Users/you/.ssh/id_ed25519):[Press enter]
    
    • 1
  4. 在提示时输入安全密码。 更多信息请参阅“使用 SSH 密钥密码”

    > Enter pass
    声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/511040
    推荐阅读
    相关标签
      

    闽ICP备14008679号