Pushing a large github repo fails with “unable to push to unqualified destination: master”

Push to refs/heads/master, just this one time.

git push origin whatever:refs/heads/master

That will create it unambiguously as a branch, and you’ll be able to push to it normally in the future.

This works because there’s no remote ref named master (it hasn’t been created yet), the target ref isn’t fully-qualified with refs/ so git can’t figure it out based on that, and the source ref is a hash rather than a name, so it can’t figure it out based on that either. By pushing to refs/heads/master it works because the second condition is true, and then afterwards master exists on the remote so the first condition is true

Leave a Comment