Configure SourceTree

Hi.

The latest version of SourceTree on windows has the following gitlab options as host:

  • GitLab
  • GitLab CE
  • Gitlab EE

sourcetree_hosts

But it does not recognize my credentials.

1 Like

Thanks for sharing that, it seems that from 3.0 onwards, SourceTree supports GitLab indeed!

With Sourcetree 3.0 for both macOS and Windows we’re proud to announce support for additional remote hosting services, namely GitHub Enterprise, Microsoft Visual Studio Team Services, and GitLab (Cloud, CE, EE).

https://blog.sourcetreeapp.com/2018/08/29/sourcetree-3-0-branches-out-with-new-hosting-services

Which options did you use to enter your credentials? Perhaps someone else can share their experiences in using the SourceTree GitLab integration and help.

1 Like

I finally found the issue, after several attempts between

  • OpenSSH and putty;
  • HTTPS and SSH;
  • generating new keys

I eventually noticed that for github and bitbucket the credentials are through “Oauth”, and for GitLab “Personal access token”. I had generated yesterday a toke, but hadn’t used anywhere.

Steps to add a repo from GitLab on SourceTree:

  1. On your browser, go to your account and > User settings > Personal Access Tokens (https://gitlab.com/profile/personal_access_tokens)
  2. Generate and copy the token
  3. On Sourcetree,
    a) leave https as preferred protocol
    b) click on Refresh Personal Access Token
    c) type your username and use the copied token as password
4 Likes

Thanks so much for coming back to share the steps you followed with everyone in the forum.

With these, and the fact that SourceTree now supports GitLab, I think we can finally mark this thread as solved :wink: :rocket: :partying_face:

2 Likes

Hi,

Add Scopes is read_user, write_repository login valid

2 Likes

For newbie users like me, an addition to the ‘manual’:
3.0 a) In the Sourcetree API, go to Tools > Options
b) click the tab ‘authentication’
c) click ‘add’
d) select the correct Hosting Service (i.e. GitLab in this case)
e) proceed to 3. a) from the post above

4 Likes

This is exact solution for adding the gitlab in sourcetree