gitgithubpersonal-access-token

Please use a personal access token instead. (But using one)


Username for 'https://github.com': username
Password for 'https://username@github.com': 
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/repo.git/'

I'm still receiving this error despite using personal access token, and it has been working fine for about 6 months, it has no expiration date.

But now I'm trying to pull some changes on my vps and this error appears.

I've created a new access token but still getting the same error.

How can I solve this?


Solution

  • Solve the problem by setting origin url before push or pull something, just like this:

    ~$ git remote set-url origin https://<githubtoken>@github.com/<username>/<repositoryname>.git
    
    ~$ git pull origin <branch>
    

    As it says here “Support for password authentication removed” for GitHub. How to Generate Personal Access Token?