Reputation: 1726
I would like to add my gitlab account to sourcetree. Inside Preferences -> Accounts, I tried the 'add' button
host: GitLab.com
Auth type: greyed out
username xxxxxx
password: xxxxxx
protocol: https
when I go to save. I get a pop up screen that says: "We couldn't connect to GitLab with your (XXXXXX) credentials. Check your username and try the password again."
I've double checked both username and password.
Upvotes: 35
Views: 36415
Reputation: 1
I had the same problem on windows 11, with sourcetree 3.4.19 and Gitlab CE.
Using the PAT does not work for me.
Finally, download certificate from my gitlab url and install it in Trusted Root Certification Authorities.
The login was successful
Upvotes: 0
Reputation: 101
PROBLEM SOLVED
The solution was (on Mac):
After this, I was able to Clone Repository ("Clone from URL").
Also, this link inspired me: https://www.awordfromnet.com/access-gitlab-via-sourcetree-updated/
Upvotes: 4
Reputation: 2353
Someone on the GitLab forum had a similar issue recently, and they documented the steps to solve it:
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:
- On your browser, go to your account and > User settings > Personal Access Tokens (https://gitlab.com/profile/personal_access_tokens)
- Generate and copy the token
On Sourcetree,
a) leave https as preferred protocol
b) click on Refresh Personal Access Token
c) type your username
d) use the copied token as password
Upvotes: 98
Reputation: 1950
I am adding some advantage to @David's answer. Follow whatever steps he has mentioned but remember to select all scopes while creating a personal token.
Upvotes: 3