Permission denied (public key) when using SourceTree, but SourceTree still registers updates
Asked by Colleen Finn:

I am having an issue with the most recent version of ST for Mac OSX. I recently downloaded it and set it up successfully with my GitLab account, cloned my repos, was able to push and pull and everything was fine. Then, I started getting the Permission Denied (public key) error and became unable to use ST for pushes and pulls. Interestingly, ST would still register when pushes and pulls were necessary and I was able to do them via Terminal (and once I did, the push/pull indicators would update in ST); however, I cannot use the UI to do it.

Things I've already tried:

Tried generating a new SSH key pair and updating GitLab with the key.

Tried uninstalling/reinstalling ST (I did this manually, and was careful to uninstall any ancillary files that were hanging out there, then emptying the trash). After I did this, I tried to create new clones from URL; however, For some reason, it did not recognize my SSH gitlab repo as a legitimate URL, even though it definitely is...and it must be, for my pushes and pulls to still work via Terminal.

At some level, ST must be connected to my GitLab account for it to work to the extent it does; yet, I still cannot use the UI. Can anyone help?


Answers:
author: Jared Snider
body: After the latest update I can Fetch/Pull/Commit but cannot Push (permission denied public key). I have checked and rechecked my ssh bitbucket settings and all is good. Pushing works perfectly fine in Terminal.

comments: author: Jared Snider
body: Ana's instructions above fixed my problem. Thanks!


author: Ana Retamal
body: Glad to hear it helped you, Jared!

Have a nice day,

Ana


author: Ana Retamal
body: Hi Colleen, I see you already tried re-installing the program, but can you try doing a clean install? These are the steps to follow:

1. [Wipe SourceTree preferences](https://confluence.atlassian.com/sourcetreekb/how-to-wipe-sourcetree-preferences-412484640.html).
2. Uninstall SourceTree.
3. Delete the directory \~/Library/Application Support/SourceTree
4. [Get the latest SourceTree](https://www.sourcetreeapp.com/) and install it.

Let us know if this worked for you!

Cheers,

Ana

comments: author: Jared Snider
body: Can't delete comment?


author: Jared Snider
body: Can't delete comment?


author: Colleen Finn
body: Unfortunately, it didn't work for me. I am still having the same issue. When I uninstalled the first time, I also deleted that directory; still, I tried it one more time and the problem persists.

Interestingly, I have another laptop with an older version of ST installed on it and it works fine. I have checked all of the visible settings there to make sure they are the same on this laptop. Is it possible to download older versions of ST to see if that fixes my issue? The one I have on my other laptop is 2.0.5.2.


author: Ana Retamal
body: Hi! You can find older versions at [SourceTree Download Archives](https://www.sourcetreeapp.com/download-archives).

Hope that helps,

Ana


author: Colleen Finn
body: Thank you. Downloading 2.0.5.8 seems to have helped. I am now able to push/pull via the UI again.

However, I am less convinced that this was a version issue--i think it was more likely a setting that I just couldn't find. Regardless, as long as it works, I am good :)


Tags: gitlab

mac