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

Pushing in Sourcetree fails but works from shell

bryanaamot May 7, 2018

From Source Tree, I get:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/master:refs/heads/master

Pushing to myusername@bitbucket.org:myusername/my-project.git

myusername@Bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.

 

But, if I copy that to the terminal, and it works fine.

I verified that ls ~/.ssh/id_rsa has the same key as found on bitbucket. And I've run 

ssh-add ~/.ssh/id_rsa which says "Identity added"

 

I'm running OSX 10.13.4, Source Tree 2.7.3, BitBucket Media Adapter 1.0.6.

My SourceTree preferences / accounts are set to OAuth/SSH but I've tried Oauth/HTTPS, Basic/SSH, and Basic/HTTPS but I still get the same error.

 

It use to work. And one time after playing with it for an hour, I got it to work again. But, now SourceTree fails again and I did't do a thing.

 

1 answer

0 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 8, 2018

With ssh, please check if the ssh-agent has your keys loaded. If not, please add them to the agent. 

Run below commands in terminal to do so,

To check if keys are loaded:

ssh-add -l

To add keys to agent:

ssh-add <path_to_key>

more like,

ssh-add ~/.ssh/id_rsa

Key in the passphrase used while generating the ssh key and you should be good to go.

 

Thanks,
Manjunath
Sourcetree Mac Developer

bryanaamot May 9, 2018

I greatly appreciate your answer. But, I'm afraid I've tried that several times. I've followed every single help discussion I could find (dozens actually).  I've literally spent over an hour trying that sort of thing. And I can't get it to work in Source Tree.

Here's the thing... when I run the exact same git command in a shell, it asks me:

    Enter passphrase for key '/Users/myusername/.ssh/id_rsa'

But wait??? I've never given the passphrase to Source Tree!  So I don't understand how it can even work! Why doesn't Source Tree ask me for a passphrase?

Or, perhaps I shouldn't be prompted for a passphrase from the shell command at all? Is this a symptom of the problem? Maybe Source Tree or the shell should know my passphrase already.

I love the Source Tree software. It's wonderful. If I could only fix the checkin part, then I wouldn't have to always run git from a shell.

Thank you again for attempting to help me.

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 15, 2018

The passphrase it is asking you is for the key you have entered while creating the ssh key. We are aware that this prompt in Sourcetree isn't properly worded to let the user know that its the passphrase for ssh key. We are working to improve this experience in upcoming releases. 

If you don't remember this passphrase, you can create a new ssh key using Sourcetree and use that on the server. 

Let me know if you need help with that. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events