I was following the instructions at https://confluence.atlassian.com/bitbucket/add-unversioned-code-to-a-repository-877177133.html
I included the last 2 steps from the link above ...
% git remote add origin https://x@bitbucket.org/...
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.
Thanks
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 git@bitbucket.org:dpenkin/test-repo.git (fetch)
origin git@bitbucket.org:dpenkin/test-repo.git (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:
git remote set-url origin <url>
git remote remove origin
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.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.