Uploading an existing local git repo to a new github/bitbucket repo.

Note to self: Bitbucket and Github’s instructions for uploading an existing local repo have this instruction:

git remote add origin <address>

But something in my set-up (posh-git?) adds a default origin entry causing this to fail with:

fatal: remote origin already exists

To fix this use:

git remote set-url origin <address>

And then upload as normal with:

git push -u origin

Maybe this post will prevent me having to look this up every time I run into it! :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>