$ git push -u origin master
Counting objects: 321523, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (85111/85111), done.
error: RPC fai
I encountered this message when we converted a mercurial repository to git and tried to push it to GitHub. The cause turned out to be that we had previously committed some libraries' .git folders into our repository and folders with that name are forbidden by git. The repository seemed to work fine locally and we even pushed it to CodeCommit successfully but GitHub is stricter about that rule and pushes to it would always fail with error: RPC failed; curl 55 SSL_write() returned SYSCALL, errno = 10053
To see if that's your issue, you can run git fsck
and look for instances of The tree contains an entry with an invalid path of '.git'
The solution for us was to use BFG Repo-Cleaner to get rid of the offending folders and we were then able to push to GitHub without issue.
$ bfg --delete-folders .git --delete-files .git --no-blob-protection my-repo.git
FYI, please thoroughly read the BFG information page before using it because it can create merging nightmares if used improperly.