Pelle Mårtenson
Pelle Mårtenson

Reputation: 151

Git Error code: No refs in common and none specified; doing nothing

I am following the rails tutorial and got stuck on chapter 1.4.3 Bitbucket. https://www.railstutorial.org/book/beginning#sec-bitbucket This is what I have written and the answer I get.

pellem@rails-tutorial:~/workspace/hello_app (master) $ git remote add origin [email protected]:pellemartenson/hello_app.git
fatal: remote origin already exists.

pellem@rails-tutorial:~/workspace/hello_app (master) $ git push -u origin --all                                                          
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
Everything up-to-date

I found some similar questions and tried some of the suggestion. But It doesn't work for me or I don't understand the answer.

Upvotes: 15

Views: 22691

Answers (4)

veekthorcodes
veekthorcodes

Reputation: 31

this works:

git push -f -u origin master

Upvotes: 3

Sawo Cliff
Sawo Cliff

Reputation: 3028

If using bit bucket, it takes certain steps for granted and as such can give you lot of pain. But here is how I fixed this issue. In your root directory of your project

    git init
    git add .
    git commit -m "message"

Then follow the steps from the initial page of the repo

    git remote add origin https://[email protected]/xxx/xxx.git
    git push -u origin --all
    git push -u origin --tags

Hope I've helped someone!

Upvotes: 49

Omar Khan
Omar Khan

Reputation: 432

I think you forgot to commit. You have an empty local repository.

Upvotes: 9

vmcloud
vmcloud

Reputation: 652

You can have a try:

git push -f -u origin master

Upvotes: 0

Related Questions