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

I am logged in but bitbucket throws an error when I try to push

dfiler:~/workspace/sample_app (master) $ git push -u origin --all
ssh: Could not resolve hostname Name or service not known
fatal: Could not read from remote repository.

I get the above error message. What am I doing wrong?


Don filer

2 answers

1 accepted

0 votes
Answer accepted

Thanks, Brian,

     I deleted the repository that was not taking my changes. I resubmitted my SSH Key and I initialized the repository again. When I pushed the project up it  indeed was missing the @ sign in the address but I included it in the git remote add origin command and it responded that it was there. I might be doing something wrong, but I can't determine what it is from my end.
Bryan Turner Atlassian Team Jun 16, 2016

When you say "it responded that it was there", I think that's an error saying there's already an "origin" remote, not that the @ sign was already present. If the remote exists, you either need to git remote rm origin to remove it, or you need to use git remote set-url origin ... to change it.

I tried changing the remote address, adding the @ sign but when I tried to push this is what I got.

dfiler:~/workspace/sample_app (master) $ git remote set-url origin
dfiler:~/workspace/sample_app (master) $ git push -u origin --all
Warning: Permanently added ',' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Bryan Turner Atlassian Team Jun 16, 2016

"Permission denied (publickey)" indicates you have not setup your SSH key correctly at Since your public key isn't setup, Bitbucket rejects your SSH request.

3 votes
Bryan Turner Atlassian Team Jun 16, 2016


I think you've got a bad remote URL in your repository. It looks like you've got "", but what it should be is "", where "git" is the username and the host address is "". Note that "git" will always be the username, not your username. Even though you push with the "git" username, your username will be associated with the push because the SSH key used to authenticate with the server is associated with your account.

You can confirm your URL by running git remote -v to see what it is. If it's not correct, you can use something like git remote set-url origin<user>/<repo>.git, where you'll need to substitute in the <user> and <repo> you're trying to push to. Unfortunately I can't glean that from the error snippet posted. You can get the exact URL you should use from the Bitbucket UI; it will be called the "Clone URL". It's shown in the upper-right corner on the overview, or by clicking the "Clone" action in the sidebar.

If you haven't associated an SSH public key with your Bitbucket account, you'll be unable to push over SSH even using the correct URL. This tutorial can help you set up your SSH key if you haven't already.

Best regards,
Bryan Turner
Atlassian Bitbucket 

Suggest an answer

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

Contest: Share your custom Bitbucket Pipe and win

Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...

556 views 2 4
Join discussion

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