Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github, sourcetree getting unauthorized error

im new to github and im using sourcetree for my git gui, ive been using it for a few days, but now lately im getting an error that says

remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/Nosthertus/nodejs_Chat.git/'

also when i tried to make another registration to github returns with error

authorization failed

maybe its because i made a two-factor security, i thought on making a shh-key with github, but does not fix the problem, there has to be a way to make my gui connect to my github account without the login access, how do i fix this?

like image 559
Oscar Reyes Avatar asked Apr 13 '14 04:04

Oscar Reyes


People also ask

Is SourceTree compatible with GitHub?

For instance, you can start by creating a project on Github and then connect it to your SourceTree software so that later on, when you update your code or include new code you can upload the data on Github using SourceTree. To start work with SourceTree, create new project on GitHub (click 'Start a Project'.)

How do I fix authentication error in SourceTree?

Ensure you are using an app password and that it is also correct (ensure there is no copy and paste error when copying the app password over to Sourcetree for Windows). Ensure Preferred Protocol is set to HTTPS. Hit Refresh Password. Make sure the page shows Authentication OK with the green checkmark, then hit OK.

How do I remove a GitHub account from Sourcetree?

Regenerated the token in github (Your Profile -> Settings -> Security then find a link saying Personal Access Tokens) (don't forget to tick the appropriate boxes to grant permissions). Then in SourceTree Tools -> Options -> Authentication and delete the accounts as others have said. Next time you try it you get a github username+password prompt.

Why is Sourcetree throwing an error when trying to clone a repository?

While using SourceTree, attempting to clone a remote repository, was throwing the following error under Repository Type: This is not a valid source path / URL Clicking on Clone will prompt the following error: The solution was simple, just updated the Git Version.

How to fix Sourcetree error when console is not working?

However, if I use console there is no error. Is proves that there is some error or my mistake in using sourcetree account managament. Open sourcetree, in the right click icon Settings (Repository settings) ->Remotes -> Select Origin and Edit: works for me too.

How to enable Git in Sourcetree?

Check Sourcetree –> Preferences –> Accounts that you are using OAuth authorisation and SSH protocol. In Sourcetree –> Preferences –> Git switch to system git. Good luck! Show activity on this post.


2 Answers

If your password recently changed, select the repository, go to Tools --> options, go to Authentication tab and delete the stored password. This will make the system request a new password when you next try to connect.

On OSX: go to SourceTree --> Preferences --> Network and delete the default username there.

like image 120
ntg Avatar answered Sep 22 '22 23:09

ntg


To work with GitHub's two-factor authentication in SourceTree you can simply use your access token instead of your password. The steps to do this are as follows:

  1. Go to your Personal Access Tokens settings in GitHub.
  2. Click on the Generate new token button.
  3. Name the token something descriptive.
  4. Select which scopes you wish to grant this token.
  5. Click the Generate token button.
  6. Copy the token and use it as a password in your hosted repositories.

Source

like image 40
Ferie Avatar answered Sep 23 '22 23:09

Ferie