Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push origin master error on new repository

Tags:

git

github

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

  1. $ git init
  2. $ git add .
  3. $ git remote add origin [email protected]:project/project.git
  4. $ git commit -m "Initial version"
  5. $ 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! :)