'error: RPC failed; curl 18 transfer closed with outstanding read data remaining when pushing my android project to github

I am having a problem trying to push my code to github. This is the error that I am facing I have tried few solutions that I have found but they all seem not to be working. This is the error that I am facing:

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly

I have tried to resolve the error by using this solution that I found in stack overflow but It has not worked

git config --global http.postBuffer 524288000

I even tried to replace http with ssh but it still did not work



Solution 1:[1]

After trying most of the solutions here:git push gives: error: RPC failed.
None of the solutions worked for me.

I got a solution inspired by this answer and it worked all I had to was to change my internet connection since it was slow. Seems slow internet causes this error

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1