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.