I've problems pushing branches above a certain 'size', i.e. multiple added files but still less than 10. Pushing an unmodified branch from master works fine. A probably relevant detail is that I'm accessing the repo through a somewhat sluggish VPN connection.
The top answer in git push fails: RPC failed; result=22, HTTP code = 411 seems related but it didn't fix my issue.
Console output:
Counting objects: 129, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (129/129), done.
Writing objects: 100% (129/129), 50.33 KiB | 464.00 KiB/s, done.
Total 129 (delta 99), reused 0 (delta 0)
error: RPC failed; HTTP 401 curl 22 The requested URL returned error: 401
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date