Answered
When cloning a private repository, I recently got this error message after typing in my password:
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/username/my_repo_name.git/'
How do I clone this repository? I need to configure password authentication token somehow?
Thanks!
GitHub no longer accepts password authentication and now uses what's called a Personal Access Token.
This is a token that you generate on GitHub that is tied to your account. Then when you do operations like cloning and pushing, Git will use that token for authentication instead of using a password.
So, first you need to generate a Personal Access Token in your GitHub account.
Here's the steps to do that:
Clone your repository again and use your Personal Access Token when prompted.
Everything should go smoothly now.
Git should cache your personal access token so you shouldn't have to re-enter it going forward (until it expires).
You need to create a personal access token on GitHub and then use that instead of your password.
The link in your terminal output gives more context for why GitHub switched to that method: https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/.
Generate the token on GitHub, save it locally somewhere on your machine, and then use it instead of your password when cloning, pushing, etc. your repository.
Easy peasy!
Generate a new token in the Developer settings section of your GitHub.com account. And save the token somewhere on your local machine.
Then update the remote URL for your Git repository:
git remote set-url origin https://<token>@github.com/<username>/<repo>
Replace <token>
, <username>
, and <repo>
in that command with your own credentials.
Go to the **Developer settings` section of your GitHub.com account and generate a new token.
Make sure you save the token somewhere on your machine. You can only access it the one time in your GitHub account.
Windows:
git:https://github.com
.MacOS:
Keychain Access
.github.com
.github.com
.