views:

36

answers:

2

As the title says I am trying to create a new branch in git on the remote repository.

To do this I have previously been using the following command.

git push origin origin:refs/heads/rounding_issue

Which normally just works and I can then run

git branch -r

To confirm.

This morning however this is not working and I have received the following error messages.

error: src refspec origin does not match any.
error: failed to push some refs to '{user}@{location}:{repository}.git'

I have googled the message and checked various sites and the only explanation people have been coming up with (that I have found) is that maybe the master branch needs pushed first or there are some things you need to commit first, I have tried a host of different things but each time the error message is the same.

I can commit to the master branch fine.

Any help would be greatly appreciated.

A: 
git push origin rounding-issue

only that

shingara
Thanks for your answer, I get the same error message when I do that only it says the refspec is rounding_issue not origin.
Toby
+1  A: 

git push origin HEAD:refs/heads/rounding_issue Works?

You can change "HEAD" with some other commit in your local repository, as "master" or "rounding_issue" (if you have that branch locally) or direct SHA-1 number.

Vi
Worked like a charm, thank you!
Toby