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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Source Tree fails to push. SSH set. Can see projects too. Edited

Can see all repos on github and bitbucket. SSH generated through sourcetree and set up on the websites. However everytime i try to push to repo that was started locally to newly created remote one. I keep getting error:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream [changed] refs/heads/master:refs/heads/master

Pushing to git@bitbucket.org:[changed]/[changed].git 

Permission denied (publickey).

fatal: Could not read from remote repository.

P.S. $ ssh -T git@bitbucket.org fails.

ssh sored in [username]-Bitbucket.pub but it looks that when it testing ssh, it does not try this one..

 

3 answers

0 votes
minnsey Atlassian Team Feb 27, 2018

Hi 

If this in on Windows have you tried setting the key in Tools/Options/General tab? 

0 votes
Ana Retamal Atlassian Team Feb 27, 2018

Hi Laurynas, can you confirm that you followed the steps at Repository setup?

Also, make sure you're using the right username and the right key. You can see which username is trying to authenticate using:

git -Tv git@bitbucket.org

You can list the available SSH keys using 

ssh-add -l

Let us know!

Ana

Seeing your comment about ssh-add I decided to run ssh-add on the key stored in ~/.ssh/<key name> (it wasn't in id_rsa).

That fixed it for me. After running ssh-add <file name> I was good to go. Now it shows up when I run ssh-add -l.

Then I found this question here where the answer says to do just that: https://community.atlassian.com/t5/Bitbucket-questions/Pushing-to-Remote-Erroring-SourceTree/qaq-p/711161

So my question is, why aren't the ssh keys generated by Sourcetree not getting added to ssh-agent?

Hi Ana, I can't try that now as I made it working by:

1. Manually deleting SourceTree generated keys froms ~/.ssh

2. Generating new key in ~/.ssh/id_rsa

3. using cat ~/.ssh/id_rsa.pub | pbcopy. As when under user settings in SourceTree it was changed to use id_rsa ssh. When pressing copy to clipboard, it copied:

-----BEGIN RSA

4. Changing config files in both ~/.ssh and project /.git

 

It still puzzles me why it did not work with key generated through SourceTree.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Sourcetree

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

3,252 views 19 18
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