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

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>

e.g.,

ssh-add ~/.ssh/id_rsa 

 

Thanks!

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,740 views 26 12
Join discussion

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