SourceTree 4.2.1 creates broken SSH config for GitLab

Roman Ivanicky February 9, 2023

I spent a day trying to solve this issue and finally found this answer on GitLab

So, SourceTree has a bug trying to interract with GitLab (on OSx 12.6.3)

First of all I tried to setup connection using private token, created in GitLab profile settings. I granted all the access to that token, added account in SourceTree, successfully logged in and I could grab the repo from GitLab using https link. 

However, I couldn't push any changes receiving error
`git@gitlab.com: Permission denied `

Using SourceTree on Windows 11 i didn't have any issue - after logging (just login/password, not a private token) I could execute any operation.

After founding the answer in GitLab I posted above I found that /Users/<User>/.ssh/config  had a wrong entry:

```
# --- Sourcetree Generated ---
Host <user>-GitLab
HostName GitLab
User <username>
PreferredAuthentications publickey
IdentityFile /Users/<user>/.ssh/<user>-GitLab
UseKeychain yes
AddKeysToAgent yes
# ----------------------------
```

I changed it to:

```
# --- Sourcetree Generated ---
Host gitlab.com
HostName gitlab.com
User <username>
PreferredAuthentications publickey
IdentityFile /Users/<user>/.ssh/<user>-GitLab
UseKeychain yes
AddKeysToAgent yes
# ----------------------------
```

and it works now.. Fix the bug guys

1 answer

1 vote
Raman Sidarakin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2023

Hello, @Roman Ivanicky 

Thanks for reporting this issue. I'm glad to hear that finally you found a workaround that works for you.

I created ticket that describes your issue. So, you will be able to track progress of fixing this bug inside this ticket https://jira.atlassian.com/browse/SRCTREE-8004

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events