hurtstotouchfire
hurtstotouchfire

Reputation: 75

Git push new branch without specifying remote name gives refspec error

I'm trying to alias a push command so I don't have to type my branch name all the time, and I'm stalled at this step:
Git push new local branch to remote, without having to specify name

This command isn't working for me. I get:

$ git push origin -u head

error: src refspec head does not match any.
error: failed to push some refs to '[email protected]:hurtstotouchfire/repo.git'

This branch was created by cloning into the repo, then using git checkout -b to create the new branch, making a commit, and then the push command above. Is there some config necessary to use this command?

Upvotes: 0

Views: 185

Answers (1)

Peter Lundgren
Peter Lundgren

Reputation: 9197

git push origin -u HEAD

HEAD is a valid ref, head is not.

Upvotes: 2

Related Questions