Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Error - Create a Repository - add unversioned code to a repository

I was following the instructions at


I included the last 2 steps from the link above  ...

% git remote add origin

fatal: remote origin already exists

% git push -u origin -all

![rejected]   master->master (fetch first)
error: failed to push some refs to 'https..'
hint: ...

Obviously I did something wrong. Any guidance appreciated.





1 answer

1 accepted

0 votes
Answer accepted

Hello @andymgutman,

The error you see means that there's already a remote with name origin registered in your repository. Git repository can have arbitrary number of named remotes. To list them along with their URLs you can run this command:

$ git remote -v
origin (fetch)
origin (push)

In this example I have just one remote called origin with two URLs: one for fetching, one for pushing (they can be configured independently, but in most cases they are same).

So I'd recommend you to do the following:

  • check your current remotes configuration by running git remote -v
  • if the remote URL there is not what you want, you can change it with:
git remote set-url origin <url>
  • or delete it with
git remote remove origin
  • or you can register new remote with a different name and then use it in your subsequent commands:
git remote add <remote-name> <url>
git push <remote-name> <branch-name>

Here's the relevant Git documentation page.

Hope this helps. Let me know if you have any questions.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,890 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you