1

When I try to push my git branch to the origin I get:

error: src refspec storybook-react-a11y does not match any.
error: failed to push some refs to 'https://github.com/user/repo-name.git'

This has been covered in previous questions but those answers all assume that you have not made any commits, do not have a master branch or are working with a new repo.

In this case, I was working with an existing repo, and had several commits listed in the git log.

I was able to solve the issue by taking the branch I was already on, creating an identical version of it and trying to push that:

git checkout test-branch
git checkout -b test-branch-v2
git checkout --set-upstream origin test-branch-v2

However, I'm none the wiser as to why I'm not able to push the original branch and I would like to understand why. I did a rebase to master before trying to push the branch, so I'm wondering if that is related.

Chris Worfolk
  • 33
  • 1
  • 1
  • 8
  • What did you type to push ? Note that a simple `git push` will, under some configs, try to push *every* branch in your repo, and in this case you'll get errors for each unsynched branch. Might be irrelevant, but worth asking to rule it out immediately. – Romain Valeri Oct 08 '18 at 13:34
  • That's a great suggestion and we considered the same thing. But as I was able to check out a `-v2` version of the branch and push that, I ruled that out. – Chris Worfolk Oct 09 '18 at 06:23

0 Answers0