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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

631 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot