When I tried to run
git push origin master --force
I just got
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
Is it something to do with not being secure? I tried creating a public key as in the answer for Fatal: The remote end hung up unexpectedly and running it again, but it still doesn't work. Am I not actually using the key? If so, how do I use it?
This error can also be thrown through missing write permissions on the repository.
My concrete case went like this:
root
user of my server (via SSH).git
linux user that should manage all git-related action.root
user in the first place, and thegit
user simply didn't have the file permissions to write anything into the repository.Seems like it can be one of a thousand things.
For me, I was initially pushing master and develop (master had no changes) via SourceTree. Changing this to develop only worked.
This looks similar to How do I get github to default to ssh and not https for new repositories. Probably it's worth trying to switch from http protocol to ssh:
I happened to have the same error at pull.
I have done the "http.postBuffer" trick. It solved it, but when I wanted to push, I encountered the error again.
What solved my problem:
1. Cloned it to an other folder with an other virtual machine. (Linux).
2. I've done my changes.
3. Pushed it with the original virtual machine where I initially couldn't push. (Windows)
This may occur after updating your OSX platform.
Open Terminal and navigate to your .ssh-folder, and enter
ssh-add -K ~/.ssh/id_rsa
I got this error when I had incorrect keypair in .ssh. Adding the pubkey to github (in settings) fixed this issue for me.