git: error: src refspec master does not match any
git
Solution
If `git status` does indicate that you do have an active master branch (since you did make a first commit after all), check if you made any typo when defining your remote: see "Push origin master error on new repository":
git remote rm origin
Then I recreated the origin, making sure the name of my origin was typed EXACTLY the same way my origin was spelled.
git remote add origin git@....
You can simplify with:
git remote set-url origin git@....
Then you can establish a tracking link between the local branch and the remote tracking branch:
git push -u origin master
You can also push it to a different branch on origin:
git push -u origin master:anotherBranch
Problem
After cloning git repository to directory "hggit" and setting the remote origin with ``` mbm:hggit my name$ git remote add origin git@code.getpantheon.com:"mystringhere" ``` After editing files I committed the changes (while located in a sub-dir) with ``` mbm:handelgroup michaelmausler$ git commit -m "first commit" [master 5a29bc8] first commit 1 files changed, 2 insertions(+), 2 deletions(-) ``` I then attempted to push file changes and received the following error ``` mbm:hggit myname$ git push origin master error: src refspec master does not match any. error: failed to push some refs to 'git@code.getpantheon.com:"mystringhere"' ```