'When I try to pull or push in GitHub, I am getting an error message: "Please use a personal access token instead."
I am using the version control as GitHub through SourceTree, but it is getting failed from 13th August, the below is the error I am getting from GitHub.
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.
Anybody know what was the problem, or how can I use the personal access token?
Solution 1:[1]
Since the OP is using SourceTree, do the following:
- Generate your Personal access tokens in Github account setting.
- Double click a repository in SourceTree, click
Setting
icon in the top right of the popup window. - Click
Remotes
in the menu tab. You will see the remote URL of this repository, which should be like thishttps://github.com/username/repo.git
. - Click
Edit
and change it tohttps://<your_token>@github.com/username/repo.git
.
DONE.
Solution 2:[2]
Step 1: Generate token : https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
Step 2: Open .git > config
file and replace [remote "origin"] URL like this
https://<username>:<githubtoken>@github.com/<username>/<repositoryname>.git
Solution 3:[3]
Faced the same issue and resolved it in this way:
Open sourcetree, in the right, click Settings (Repository settings) ->Remotes -> Select Origin and Edit:
Set URL/Path in the following format: https://<your_personal_access_token_from_github>@<git_url>.git
Solution 4:[4]
Beginning August 13, 2021, Github no longer accepts account passwords when authenticating Git operations and will require the use of token-based authentication.
Guide Line Youtube Video: https://youtu.be/eZrOd5qM5WM Steps to create Personal Access Token: http://mtahirmunir.com/github-support-for-password-authentication-was-removed/
Solution 5:[5]
First of all you need to create a Personal access tokens by going from your Github account -> Settings -> <> Developer settings -> Personal access tokens -> Generate new token. You specify a name for the token, expiration date, as well as what possibilities it may have. After clicking "Generate token", make sure you keep the code that will appear because you will use it as a login code to log in to Sourcetree with a Github account instead of your original github password.
Now, you have to re-enter your details to login, using as password the token you created. To do this, go to C:\Users\{your_user_folder}\AppData\Local\Atlassian\SourceTree
and delete the passwd
file, so force Sourcetree asks you to re-enter credentials.
Open SourceTree normally, and when it asks you to enter credentials, as password enter the token as mentioned above.
Solution 6:[6]
Faced the same issue with Sourcetree on MacOS.
You can also use Auth Type Basic in Sourcetree and use the PAT as your password.
To make it work I also had to delete the GitHub internet password from the keychain (see here https://howieyoung.medium.com/suffering-from-the-latest-403-error-from-github-on-sourcetree-e04a844efd35)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | ouflak |
Solution 2 | Parth kharecha |
Solution 3 | Ankit Uniyal |
Solution 4 | |
Solution 5 | Minas-Theodoros Charakopoulos |
Solution 6 | user2264438 |