Hi,
It seems to be impossible to add an existing GitLab account to SourceTree. When requested for authentication, though using correct username and fresh password, it continuously fails.
Any suggestions that doesn't involve using a different repo provider?
Hi
You need to use a Personal Access Token https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
We are improving the text on those dialogs to reflect this
Thanks for the suggestion. I should have elaborated the steps that lead to the issue.
In first instance, an attempt to text copy the personal token from Gitlab to Sourcetree proved impossible to accomplished. The text box for the personal token was present but completely inactive, making impossible to write and/or copy text.
The next step was to click on the Refresh Personal Token. This popped up a login window, which lead to the authentication issue.
Any options to introduce the Personal Token?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, to clarify.
yes you need to click on the Refresh Personal Access token and then in that popup dialog enter your username and use the PAT as the password there.
Is this what you were doing and you still got the error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I proceeded as you suggested and that worked smoothly. Thank you very much!
I would suggest changing the UI and messaging a little. The whole thing is a bit misleading.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, some small improvements are already in progress
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, i've same problem using SourceTree 3.1.2 (216) but i no have a Refresh Personal Access token button !
How can i do ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since this question has been marked as Solved but the problem still exists for later Sourcetree versions, or for Sourcetree on Mac, or both together, I have opened a new question to address the remaining problem here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Solution found: enter your personal access token as the password. Do not enter your GitLab password.
It's not clear to me which scopes are required for the personal access token in this case. I used "api" and "read_user" and they worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Entering the token helps with the Account add for Sourcetree; however, when you push/pull changes, you get the following prompt and the token doesn't clear this password requirement:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just got a reply from the GitLab team: https://forum.gitlab.com/t/unable-to-authenticate-gitlab-in-sourcetree/41623/4.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This works, but only for ONE gitlab account. If you have to sign into more than one gitlab account, you will constantly be kicked out of the previous one as soon as you refresh credentials for another one. How can you down vote this "accepted" answer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Go to this link https://gitlab.com/profile/personal_access_tokens and create a personal access token
2. From source tree, Tools/Option. Click Authentication tab, add account, choose gitlab and enter username as name of personal access token, password is Personal Access Token.
=> Done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
WTF!! this workarround works!
We put password as access token and our username and works fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm using 3.1.2 on a Mac and running into this same issue, except I don't see Tools / Options anywhere within Sourcetree and no option to Refresh PAT. Please help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi joseposes22, I'm using 3.1.2 on my windows 10. I've tried your method, but it didn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For me it didn't work too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unable to find Refresh Personal Access token button on SourceTree 3.1.2 (225).
How Can we do?
Team , Please look into this asap.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm now able to add the account with the token hack; however, on git push/pull I get a password request where neither my Gitlab password or token works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It turns out the prompt is asking for the `ssh` password, see Gitlab support thread here:
https://forum.gitlab.com/t/unable-to-authenticate-gitlab-in-sourcetree/41623/4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
not working at all. i even removed all auhentication fields, yet when i try to push my code to gitlab repo i get basic auth failed, you need access token.
i did setup access token, my access token has FULL access.
in old 1.9 source tree same token works flawless, but in new fugly 3.x nothing works. removing all account restarting git, doesn't work. adding manually account to setting (which creates 2 entries, one for basic auth, and one account) doesn't work. yes PAT refresh token says SUCCESS but PUSH to repository always fails.
guys can you finally fix this?
it's huge pain, and whenever i forget to decline upgrade to 3.x shit. i need to revert back to 1.9 to get working git client.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok small update (i found this, when i was solving another problem - after update terminal didn't work - switching to "system" git instead of embeded git solved not only terminal problem, but also "authentication" issue)
so authentication doesn't work with embeded git, but does work with system git.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have system git version selected...
I use GitLabEE, and when I refresh Personal Access Token and I put my GitLab username y the PAT generated token from GitLab, it does not work.
So, it is impossible to connect. Please, could anyone recommend me another tool, NOT Sourcetree? Thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a new token, using my username like name of token and when I tried to login in sourcetree, in my password I type this
And my login was successful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After more than a year, it's still an issue that forced me to google and waste 30min of my time reading discussion threads!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If anyone else can't resolve this, of course follow @Quy Ho's instructions, but also make sure you're choosing the correct GitLab Hosting Service. Mine was GitLab CE and I spent some unnecessary time trying to log in with GitLab.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
GitLab EE ended up working for me. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I would like to recommend to all guys this link and it works for me
https://www.awordfromnet.com/access-gitlab-via-sourcetree-updated/
As I know, this resolved my issue when I put my PAT as password and username for login. But it seems to not working because it is missing api scope.
It’s probably late, but hopefully it helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Just wanted to update this thread to let you know there is now a native automation trigger for GitLab with Jira Cloud. We are running a webinar soon to walk through how it works and show some use cases in how to automate from Gitlab to Jira. Feel free to register here: https://www.atlassian.com/webinars/software/automate-across-gitlab-and-jira
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.