I created a local repository for a C# project, and I've made a lot of commits to it over the past few days.
This evening I opened Git Bash so I could push the repo to Github for the first time. I've already created an empty repo in Github for this purpose.
I entered:
git push origin master
I was then prompted to enter my Github username and password. After that, I got this message:
warning: ignoring broken ref refs/heads/master.
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/myusername/myrepo.git'
I then ran git status
, and under Changes to be committed:
it showed all the tracked files as new files.
I ran git log
and got this error:
fatal: bad default revision 'HEAD'
What's going on here, and how do I fix it?
UPDATE: I tried committing and got this message:
error: unable to resolve reference HEAD: No such file or directory
fatal: cannot lock HEAD ref