Skip to content

Instantly share code, notes, and snippets.

@oleksis
Created March 7, 2024 11:15
Show Gist options
  • Save oleksis/eb5c625f69a527ade2c4d6fbe76a6b9b to your computer and use it in GitHub Desktop.
Save oleksis/eb5c625f69a527ade2c4d6fbe76a6b9b to your computer and use it in GitHub Desktop.
Git push error: HTTP 400

The error you're encountering is often due to issues with the HTTP version or the size of the data being pushed. Here are a few potential solutions:

  1. Switch to HTTP/1.1: The error message points to an issue with HTTP/2. You can force Git to use HTTP/1.1 with the following command¹:
git config --global http.version HTTP/1.1
  1. Increase the post buffer size: If you're pushing data larger than the postBuffer size, you may encounter this error. Increase the post buffer size with the following command¹³⁴:
git config --global http.postBuffer 157286400
  1. Check your internet connection: Slow or unstable internet connections can sometimes cause this error². If possible, try to push your changes using a more reliable internet connection.

  2. Push smaller changes: If you're pushing a large amount of data, you might encounter this error². Try to push smaller changes if possible.

Remember to replace --global with --local if you want to apply these settings only to the current repository¹. If none of these solutions work, please let me know so I can assist you further.

Source: Conversation with Bing, 3/7/2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment