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

I can't connect to Github from Sourcetree

Agustin Vijoditz Mar 06, 2014

I tried several times. I even changed my password twice and I still can't login. I'm using the Setup Wizard, my Github username(not my email) and password, and I get the same error:

 

Login error

Login failed for the following accounts:
GitHub: Bad credentials

Do you still want to proceed?

 

I'm able to login with bitbucket with no problems... any ideas?

 

I'm using SourceTree 1.8.1 for Mac under OS X Mavericks 10.9.2

13 answers

1 accepted

8 votes
Answer accepted
Jeff Thomas Atlassian Team Mar 07, 2014

I think I can recreate a similar error that you're running into (maybe). If I run through the setup wizard with an incorrect password for GitHub and finish the setup wizard, it seems like the incorrect password is getting cached. If I then run the setup wizard again and use the correct password, it won't accept it. Have you run the setup wizard before or is this the first time?

I was able to work around the error by finishing the setup wizard then selecting View > Show Hosted Repositories and choose Edit Accounts. I then set the password for my GitHub account.

Try setting the password outside of the setup wizard and see if that fixes the issue.

Peter Hollingsworth Sep 28, 2016

Using Mac 2.3.1. Basically did what you suggest via:

  1. Window/Show Remote Hosted Repositories
  2. Then in the popup click the gear and choose Settings,
  3. Then delete the non-working account, click Add Account and re-add with the correct password.
Like Nikhil Singh likes this

Using the Mac version 2.3.1, today I still couldn't do this. I had to use the Personal Access Token mentioned by Jonathan.

Like cadabra06 likes this
Miguel Forero Jun 26, 2018 • edited

...

20 votes
Jonathan Doughty Mar 26, 2016

On a Mac, with SourceTree 2.2.3 I found that I could work around this by creating a Personal Access Token at https://github.com/settings/tokens , and then use that as the value for the Password for the Protocol: HTTPS in SourceTree's Repository Browser, Remote... Settings... Edit Account dialog.  Jeff's solution didn't work for me.

Todd Lininger Sep 08, 2016

This worked beautifully. Thanks.

A tip: when GitHub shows the generated token, there is a small space (less than half a char) just before the token string. If you select the string by dragging with the mouse, you'll probably end up grabbing that space, and since the password field is masked in SourceTree, you won't realize when copy+pasting. This caused me some head scratching.

Of course using the "copy token" icon works beautifully, so maybe use that ;P.

Like 金興基 likes this
Jóhann Sigurðsson Jul 04, 2017

GAAAH!! That was it !

Steven Vachon Jan 31, 2018 • edited

This is the only thing that worked to correct the repo browser. I still can't push to some private repos, though.

David Rees Jan 05, 2019

Thanks for tip! FYI, This is needed if two factor authentication is turned on. More info in https://developer.github.com/v3/auth/#working-with-two-factor-authentication.

That worked for me, many thanks!

Adam Laskowitz I'm New Here Apr 11, 2019

I, for the life of me couldn't get login to work correctly on Sourcetree with Github - thank you so much for posting this! It actually worked.

5 votes
Steven Vachon Jan 31, 2018

Changing the repository's URL from https://github.com/user/repo to git@github.com:user/repo.git fixed it for me.

Till Simon May 29, 2018

Thanks. Strangely enough, this did trigger a different login popup (with 'git' as username) and using my personal access token as password did the trick (using my regular password would have worked as well I assume).

1 vote
IriaPoncelaBlanco Aug 17, 2018

I'm also having this issue, I updated sourcetree to the latest version today, 2.6.10, and Git is on the 2.17.1, and it does not fix it. I read somewhere that there was a fix for an older version but it did not work for me. When is this going to be fixed? ( I'm using a MAC that has windows running)

1 vote
Raquel Geijo Sep 05, 2018

Hi! I'm having the same problen in W10 with sourceTree V 2.6.10. No Workaround worked for me.

Diego Prananta Sep 11, 2018

Same here.

I am using Source Tree V 2.6.10. My github has 2 factor authentication enabled as well as SSH connection setup.

Like Damian Szpura likes this
0 votes
Agustin Vijoditz Mar 06, 2014

Thanks Jeff, I forgot that, I just updated the post with this:
I'm using SourceTree 1.8.1 for Mac under OS X Mavericks 10.9.2

0 votes
Jeff Thomas Atlassian Team Mar 06, 2014

Which version of SourceTree are you using and on what platform?

0 votes
Agustin Vijoditz Mar 07, 2014

Ok, thanks, now it works!

Tore Forsgren Jun 14, 2019

First i tried one thing and then another thing.

Then I finally fixed it.

0 votes
EPT Nov 19, 2015

Hi , Is the problem still there? 

Orlando Marconi Apr 23, 2016

yes

Greg Sudderth Jun 02, 2016

I see it as well.

Rinto Rapheal Jun 22, 2016

Still facing the issue.

0 votes
Denis Christ Dec 01, 2015

Edit: i still have this problem, following Jeff top didn't solve it.

 

This problem still exist. Follwing the tip from Jeff Thomas , helped me fix it

I was able to work around the error by finishing the setup wizard then selecting View > Show Hosted Repositories and choose Edit Accounts. I then set the password for my GitHub account.

 

/Dennis 

0 votes

Hi

I seem to have a similar issue.  Everything was working fine, but this afternoon I updated to v1.6.24.0 (on Windows 7 x64).  I try fetching on a Bitbucket repository, but it keeps asking my password, even after I enter it, it just asks it again as if it is incorrect (but I can login online with the same username and password).

I went to View->Show Hosted Repositories and Edit Accounts, changed the password, the window says Password OK, even try Set Default thereafter, but still, every time I try and access Bitbucket it asks for the password even though I enter it correctly.

Ideas?  Or should I start a new question?

Wiaan Beeton Dec 01, 2015

We're experiencing the same problem after updating to the newest version of SourceTree (three guys in my office). Thinking it's a bug introduced with the update

We have the same issue at my office. I often experience poor quality when it comes to the source tree client updates. Not only does it often require a re-installation since the auto update almost always fails, updates also tends to introduce new issues rather than solving issues.

Kireet Kokala Dec 01, 2015

I'm having the same issue after the update

Alan Anderson Dec 01, 2015

I have the same problem. Just updated and now dead in the water. I went to View->Show Hosted Repositories and Edit Accounts, changed the password, the window says Password OK. I am using github.

Jeff Thomas Atlassian Team Dec 01, 2015

This is a known issue and we're tracking the fix at https://jira.atlassian.com/browse/SRCTREEWIN-3944 Until the fix is released, there are two workarounds available. Workaround 1 Downgrade and install SourceTree 1.6.23 (or an earlier version): http://downloads.atlassian.com/software/sourcetree/windows/SourceTreeSetup_1.6.23.exe. Workaround 2 As a temporary workaround copying the attached Askpass.exe.config file (available on the above bug ticket) in to C:\Program Files (x86)\Atlassian\SourceTree (or the installation folder respectively). This will provide the necessary configuration and should fix the multiple authentication requests.

Thank you Jeff, was sure somewhere it'd be tracked at least, but couldn't find it. I've opted for Workaround 2 and it works. Have a good day!

IriaPoncelaBlanco Aug 17, 2018

the first workaround kind of fix it for me, many thanks!

0 votes
Dmitry Grigansky Mar 24, 2016

Have same problem, following the tip from Jeff Thomas, helped me fix it.

0 votes
visoor Apr 08, 2019

Using Basic Login method worked for me, thanks

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Off-topic

What podcasts are you listening to right now?

Like the title says: what podcasts are in your rotation right now? Here are some favorites I've been in to from the last few weeks. The Ringer NBA Show I've been diving deep into the NBA Playoffs...

1,166 views 21 10
Join discussion

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