If you received a mail from GitHub about - [GitHub] Deprecation Notice. Which warns about: Basic authentication using a password to Git is deprecated and will soon no longer work.. Then this article shows how to resolve it for PyCharm.

For more information on PyCharm and GitHub configuration:

Full text of the warning mail:

Hi XXX,

You recently used a password to access the repository at XXX with git using git/2.17.1.

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.

Thanks,
The GitHub Team

Follow these steps to avoid future problems.

Step 1: Generate New Github Account Token

First you will need to generate a new personal access token which will be used for authentication. This can be done by visiting: Personal access tokens

  • Personal access tokens
  • Generate new token
  • Confirm Password - you will be asked to confirm your password
  • At New personal access token
    • select name for the token
    • select scopes
      • repo - everything
      • gist - everything
      • org - read:org
  • Generate Token
  • Copy the token and keep it - this is important because you will lose access to it after closing.

Note: If you don't select the scopes you will get a warning message later.

github-github-deprecation-notice-personal-access-tokens

Step 2: PyCharm Add Github Token

Next step is to configure the Github token to PyCharm to use the token. Start PyCharm and follow:

  • File
  • Settings - CTRL + ALT + S
  • Version Control
  • GitHub
  • Click on the plus on the right - Add
  • Log in with Token
  • paste the token
  • Add Account

Note: If you see a red warning message like:

Incorrect credentials: Insufficient scope granted to token

then you need to go back to step 1 and regenerate the token with appropriate scope.

github-deprecation-notice-recently-used-password-access-repository