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?
Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub Enterprise Server when using the GitHub API or the command line. A token with no assigned scopes can only access public information. To use your token to access repositories from the command line, select repo .
To solve this problem all we need to do is create a GitHub personal access token and use it instead of our GitHub password and a two-factor authentication code. Now, step by step guide. Creating a GitHub personal access token. In the upper-right corner of any page, click your profile photo, then click Settings.
If you are using PhpStorm, go to menu Git => pull and select authentication via Personal Access Token. Enter your PAT it will allow you to pull/push the changes. Be sure to save the token on some local file or in some cloud.Upvoted. Given that the OP states they already created a token two weeks ago, this doesn't address the actual problem.
However, it also prompts you to enter your GitHub credentials every time you pull or push a repository. When Git prompts you for your password, enter your personal access token (PAT) instead. Password-based authentication for Git has been removed, and using a PAT is more secure.
However, it also prompts you to enter your GitHub credentials every time you pull or push a repository. When Git prompts you for your password, enter your personal access token (PAT) instead. Password-based authentication for Git has been removed, and using a PAT is more secure. For more information, see " Creating a personal access token ."
Since the OP is using SourceTree, do the following:
Setting
icon in the top right of the popup window.Remotes
in the menu tab. You will see the remote URL of this repository, which should be like this https://github.com/username/repo.git
.Edit
and change it to https://<your_token>@github.com/username/repo.git
.DONE.
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
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
The other way to solve this is from git config file. For this, in your .git folder open open config file and replace [remote "origin"] URL like this
[remote "origin"]
url = https://<your_personal_access_token_from_github>@<git_url>.git
fetch = +refs/heads/*:refs/remotes/origin/*
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/
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With