If you see `error: failed to push some refs to ‘…’ use the following workaround and try again.

git config http.version HTTP/1.1

Last tested with git version 2.32.0 and git-lfs version 2.13.3 on Mac OS X 10.14.6 Mojave.


Azure Dev Repos is a wonderful place to version control Logic projects, because it has unlimited storage and support LFS.1

A particularly large project (20 GB, largest file 225 MB) was failing to push to the server. I’ve seen two variations of this error: either an HTTP 413 or an HTTP 503 error while pushing a project. To all salt to the wound, it was happening in the final 1%.

$ git push --set-upstream origin master
Uploading LFS objects:  99% (678/686), 18 GB | 2.0 MB/s, done.
Fatal error: Server error: from HTTP 503
Fatal error: Server error: from HTTP 503
LFS: Client error: from HTTP 413
error: failed to push some refs to ''

Apparently this is a known problem, specific to Azure Dev Repos only.2 The workaround is to downgrade the HTTP protocol used by Git so that the large files go through.

$ git push --set-upstream origin master
Uploading LFS objects: 100% (686/686), 20 GB | 2.6 MB/s, done.                  
Enumerating objects: 805, done.
Counting objects: 100% (805/805), done.
Delta compression using up to 8 threads
Compressing objects: 100% (794/794), done.
Writing objects: 100% (803/803), 5.74 MiB | 1.82 MiB/s, done.
Total 803 (delta 31), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (803/803) (2601 ms)
remote: Storing packfile... done (182 ms)
remote: Storing index... done (40 ms)
   5d884b1..3b9e73d  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

I would recommend issuing the command without the -g flag, so that the http.version override is logic to the git project only. If needed, revert changes using git config --unset http.version.


  1. That’s why I made this: