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:

  1. Open the terminal, get into your project directory
  2. Type git config credential.helper store
  3. Type git pull
  4. 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:

  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.

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.

enter image description here