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

Pushing to Remote Erroring - SourceTree

bisonbrah January 24, 2018

"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
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2018

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!

bisonbrah January 28, 2018

That did it thank you!

sadlerville January 29, 2018

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
TAGS
AUG Leaders

Atlassian Community Events