Pushing to Remote Erroring - SourceTree

"Pushing to git@bitbucket.org:bisonbrah/vapeology-custom.git

git@bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.


Please make sure you have the correct access rights

and the repository exists."


Everything worked just fine for well over a year - checking SSH on mac and bitbucket and is is 100% accurate. Can anyone help me figure this out?


I can manually push via cmd; but NOT with SourceTree >.<

1 answer

1 accepted

2 votes
Answer accepted

If you've recently upgraded the OS or restarted your mac, please check if the ssh keys are loaded to the ssh-agent. Run below command to check if they are added and to add it if none found. 

List keys

ssh-add -l

Add key

ssh-add <path_to_key>


ssh-add ~/.ssh/id_rsa 



That did it thank you!

I don't think this is fixed.   Here is what I think is happening:


Boot MacOS High Sierra.  Log in.  Open a terminal.  SSH-agent is running.  Set up all of your SSH keys (ssh-add -A is great for this).   Everything is happy.   Can push/pull from the git command line, no problem.  Happy days.

At this point, I have ONE ssh-agent process running (process ID 1106).   It has my keys:

> ps -e | grep ssh-agent

1106 ??         0:00.16 ssh-agent -s
> ssh-add -l

<my keys> - all is good and right


Now, fire up SourceTree from Spotlight or some other app launcher.   Try to do a push or pull.   Hang on, now two ssh agents are running.


> ps -e | grep ssh-agent 
1106 ??         0:00.16 ssh-agent -s
13136 ??         0:00.01 /usr/bin/ssh-agent -l

It looks like SourceTree started another ssh-agent.  I think that is the source of the problem.   Note that if I launch SourceTree directly from the terminal, from which my ssh-agent is already running.  It works fine.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

....sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

188 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you