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: unable to access ‘https://github.com/piyas33/browser_web_react.git/': The requested URL returned error: 403
Official explanation:https://github.blog/changelog/2021-08-12-git-password-authentication-is-shutting-down/
Solution:
To fix the error, follow the below steps:
https://github.com/settings/tokens
- Your Profile Settings
2. Click Developer settings below on the right side.
3. Click Personal access tokens.
4. Click Generate New Token
5. Write the token name:
6. After generating the token, Copy this.
7. This token is used as a password.
Important Note: To store the token git credential so you don’t have to type the token every time, use this command before pushing.
git config credential.helper store
Permanently Save Token:
- Now, open the Git repository where you got the error and remove the current origin by running the following command.
git remote remove origin
2. Add the new origin using the following command in your terminal.
git remote add origin https://<TOKEN>@github.com/<USERNAME>/<REPO>.gitExample:git remote add origin https://gh-222dfrefgblogdemodjjd2n2@github.com/piyas33/blog_demo.git
That’s it, now you can push your code to GitHub using the git push
command without any errors.