You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Git推送文件报错413 Request Entity Too Large(Windows 10环境)

Fixing Git 413 Request Entity Too Large on Windows 10 (No Nginx)

Hey there, let’s work through this 413 error you’re hitting when pushing files with Git. Since adjusting git config http.postBuffer didn’t help and you’re not using Nginx, the issue almost certainly lies with the Git server you’re connecting to or intermediate network restrictions. Here’s how to tackle common scenarios:

1. If you’re using a managed Git platform (GitHub/GitLab/Bitbucket)

These services have built-in file size limits (e.g., GitHub caps single files at 100MB, and recommends total repo size under 1GB). The postBuffer tweak won’t bypass these—you need to use Git LFS for large files:

  • Install Git LFS: On Windows, grab it from the Git installer’s optional components, or run winget install Git.GitLFS in Command Prompt/PowerShell.
  • Track your large files: Run git lfs track "*.zip" (replace .zip with your file’s extension or exact filename).
  • Commit the auto-generated .gitattributes file, then retry your push.

2. If you’re running your own Git server

The fix depends on what web server you’re using to host Git:

IIS (common on Windows servers)

  • Open IIS Manager, navigate to your Git site.
  • Double-click Request Filtering, then click Edit Feature Settings on the right sidebar.
  • Increase the Maximum allowed content length (value is in bytes—set to 536870912 for 512MB, for example).
  • For extra assurance, add this to your site’s web.config file:
    <system.webServer>
      <security>
        <requestFiltering>
          <requestLimits maxAllowedContentLength="536870912" />
        </requestFiltering>
      </security>
    </system.webServer>
    

Apache

  • Locate your Apache config file (e.g., httpd.conf or your site’s .htaccess file).
  • Add or modify this line to set the max request size (again, bytes—512MB example below):
    LimitRequestBody 536870912
    
  • Restart Apache to apply changes.

Git for Windows built-in server

If you’re using git daemon (Git protocol) or SSH, the 413 error shouldn’t happen over these protocols—switch to SSH for pushes instead of HTTP/HTTPS. If you’re using git http-backend, you’ll need to pair it with IIS/Apache and follow the above steps for those servers.

3. Check for network restrictions

  • Windows Firewall/antivirus: Temporarily disable your firewall or third-party security software to test if it’s blocking large requests (don’t forget to re-enable it afterward).
  • Proxy servers: If you’re behind a company or local proxy, the proxy might enforce its own size limits. Contact your network admin to adjust these, or configure Git to use the proxy with appropriate settings.

内容的提问来源于stack exchange,提问作者SaKH

火山引擎 最新活动