user2083200
user2083200

Reputation: 9

Git Push Error | Bitbucket Repository

We are trying to push our local contents to our repository in "Bitbucket" but we are getting the following error while trying to "git push" after committing our files.

Error Message

$ git push -u origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Can you people help us in this regards?

Upvotes: 1

Views: 8950

Answers (4)

andyrandy
andyrandy

Reputation: 74014

I just had the same problem, this may help you:

#initialize git in the folder   
git init
#add remote repository (this did not work for me)
git remote add origin https://myusername@bitbucket.org/myusername/myrepo.git
#...so i changed it later (after some git add and commit commands)
git remote set-url origin https://myusername@bitbucket.org/myusername/myrepo.git
#now it worked:
git push -u origin master

If you get the error message remote origin already exists, run this:

git remote rm origin

Upvotes: 4

Developer
Developer

Reputation: 26283

I mistakenly ran following with 'i' missing in origin.

git remote add orign url

Only find out when view it using below command

git remote -v

and remove it using

git remote remove orign

and created it again with correct spelling using

git remote add origin url

Upvotes: 0

Aamir Yaseen
Aamir Yaseen

Reputation: 487

You may try git push --mirror url-of-your-bitbucket-remote

Upvotes: 0

Michael Anderson
Michael Anderson

Reputation: 73580

It looks very much like you have failed to run a git remote add command.

Usually this would look like

git remote add origin ssh://git@bitbucket.org/[USERNAME]/[REPONAME].git

But you should be able to find the correct info for your repository if you follow the docs here: https://confluence.atlassian.com/display/BITBUCKET/Importing+code+from+an+existing+project

Upvotes: 3

Related Questions