I was having the same issue and then smacked myself in the head because I hadn't actually added my project files.
git add -A
git commit -am "message"
git push origin master
The error message leads to the conclusion that you do not have a master
branch in your local repository. Either push your main development branch (git push origin my-local-master:master
which will rename it to master
on github) or make a commit first. You can not push a completely empty repository.
I had the same issue. I deleted the .git folder then followed the following commands
$ git init
$ git add .
$ git remote add origin [email protected]:project/project.git
$ git commit -m "Initial version"
$ git push origin master
I have same issue . it's solved my problem . İf you init your git . you have to do on Terminal
1) git add .
2)git commit -m "first commit"
For send to bitbucket
3) git push -u origin --all # pushes up the repo and its refs for the first time
I just had the same problem while creating my first Git repository ever. I had a typo in the Git origin remote creation - turns out I didn't capitalize the name of my repository.
git remote add origin [email protected]:Odd-engine
First I removed the old remote using
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 [email protected]:Odd-Engine
No more error! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With