Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Authentication failed on Gitlab account adding



   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?

7 answers

1 accepted

2 votes
Answer accepted
minnsey Atlassian Team Feb 21, 2019


You need to use a Personal Access Token

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?


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?

Like # people like this

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.

minnsey Atlassian Team Feb 26, 2019

Yes, some small improvements are already in progress

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 ?


Like # people like this

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.

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.

Like # people like this

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:


Screen Shot 2020-08-19 at 9.30.17 AM.png

Screen Shot 2020-08-19 at 9.31.19 AM.png

1. Go to this link 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

WTF!! this workarround works!

We put password as access token and our username and works fine.

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!

Hi joseposes22, I'm using 3.1.2 on my windows 10. I've tried your method, but it didn't work. 

For me it didn't work too.

Unable to find Refresh Personal Access token button on SourceTree 3.1.2 (225).
How Can we do?
Team , Please look into this asap.

Screenshot 2019-07-12 at 8.22.26 PM.png

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.

GitLab EE ended up working for me. Thanks!

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.

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.



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!!

Like Thuy_Doan likes this

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 thisasdadadsad.PNG

And my login was successful

After more than a year, it's still an issue that forced me to google and waste 30min of my time reading discussion threads! 

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.

It turns out the prompt is asking for the `ssh` password, see Gitlab support thread here:

0 votes

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:


Suggest an answer

Log in or Sign up to answer
Community showcase
Published 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...

3,250 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you