I’m using GitHub PAT to connect to my repository
but since 13 August 2021, it always throws with
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
Here is the fix that worked for me:
Use GitHub CLI
GitHub CLI will automatically store your Git credentials for you when you choose HTTPS
as your preferred protocol for Git operations and answer «yes» to the prompt asking if you would like to authenticate to Git with your GitHub credentials.
- Install GitHub CLI on macOS, Windows, or Linux.
- In the command line, enter
gh auth login
, then follow the prompts.- When prompted for your preferred protocol for Git operations, select
HTTPS
. - When asked if you would like to authenticate to Git with your GitHub credentials, enter
Y
.
- When prompted for your preferred protocol for Git operations, select
This is my prompt steps:
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: AA87-987F
– Press Enter to open github.com in your browser…
✓ Authentication complete. Press Enter to continue…
– gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as *****
Hope it helps you.