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

10 answers

1 accepted

8 votes
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.

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.

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

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 vote
Jeff Thomas Atlassian Team Mar 06, 2014

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

Ok, thanks, now it works!

Hi , Is the problem still there? 

Still facing the issue.

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 

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!

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Wednesday in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

176 views 0 4
Read article

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