I made a new branch, checked it out and made a commit:
git branch my-branch [HASH]
git checkout my-branch
git commit -am "Add some stuff to my new branch"
However, I can’t push it to github. git push origin my-branch returns:
error: src refspec branch does not match any.
error: failed to push some refs to 'https://github.com/Me/my-project.git'
git show-refs looks like this:
[HASH] refs/heads/my-branch
[HASH] refs/heads/master
[HASH] refs/heads/some-branch
[HASH] refs/remotes/origin/master
[HASH] refs/remotes/origin/some-branch
[HASH] refs/stash
What do I need to do?
The branch doesn’t exist on github, when you push git checks the refs of origin for your branch and doesn’t find it.
Add the branch as a remote branch:
git 1.8.x
git 1.7.x
Now you can push.