SourceTree keeps asking for Github password
I am using a SSH key, but SourceTree was asking me a password every time.
Found on the community of Atlassian, this solution worked for me:
- Open the terminal, get into your project directory
- Type
git config credential.helper store
- Type
git pull
- Input username/password (if asked)
Voilà !
A solution worked for me given by Andrew Magill, Copied from Source : link
The problem is that SourceTree's embedded Git client comes with git-credential-manager v1.12, which no longer works with Github since they disabled TLS 1.1 on their site. You need to get git-credential-manager v1.14. Easiest way to do that is to install a current copy of the Git client separately, and then switch SourceTree over to use that ("system git") instead of its embedded client. Alternatively, you can update git-credential-manager in your embedded client by replacing its files with the newest version from Microsoft.
If you are using two-factor authentication with GitHub you will need to create a personal access token and use it with SourceTree:
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:
- Go to your Personal Access Tokens settings in GitHub.
- Click on the Generate new token button.
- Name the token something descriptive.
- Select which scopes you wish to grant this token.
- Click the Generate token button.
- Copy the token and use it as a password in your hosted repositories.
You can find more information about this on GitHub's help here.
Mac Users: If your SourceTree keeps on asking for the password, go to the Terminal and type this:
git config --global credential.helper osxkeychain
Follow to @Chris answer in case you've enabled 2FA, to use Personal Access Token
in SourceTree, you need to add your acc with this token in SourceTree > Preferences with following information:
- Auth Type: Basic
- Username: {your-github-account}
- Password: {your-personal-access-token}
- Protocol: HTTPS
After that, you are able to clone your Github repo.