I can't connect to Github from Sourcetree

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

11 answers

1 accepted

This widget could not be displayed.
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.

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.

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.

This widget could not be displayed.

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.

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.

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

This widget could not be displayed.

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

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).

This widget could not be displayed.

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

This widget could not be displayed.
Jeff Thomas Atlassian Team Mar 06, 2014

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

This widget could not be displayed.

Ok, thanks, now it works!

This widget could not be displayed.

Hi , Is the problem still there? 

Still facing the issue.

This widget could not be displayed.

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 

This widget could not be displayed.

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?

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.

I'm having the same issue after the update

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!

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

This widget could not be displayed.

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

This widget could not be displayed.

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)

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

173 views 18 7
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you