Permission denied (public key) when using SourceTree, but SourceTree still registers updates

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?

2 answers

0 votes


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
  2. Uninstall SourceTree.
  3. Delete the directory ~/Library/Application Support/SourceTree
  4. Get the latest SourceTree and install it. 

Let us know if this worked for you!



Can't delete comment?

Can't delete comment?

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

Hi! You can find older versions at SourceTree Download Archives.

Hope that helps,


Thank you. Downloading 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 :)

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.

Ana's instructions above fixed my problem. Thanks!

Glad to hear it helped you, Jared!

Have a nice day,


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,210 views 4 2
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