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.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.