Search code examples
githubrepositorytoken

Git Authentication failed. New generated token doesn't work


could someone help me to fix this issue? I'm trying to connect my local repository to GitHub, but I have got this error.
I have tried so many times to solve it without success, following the documentation or generate a new token, as well.
Thanks in advance

Username for 'https://github.com': [email protected]
Password for 'https://[email protected]@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls 
for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Username/horizontal-gallery.git/'

I would like to access again on my GitHub profile, and work with it.


Solution

  • Make sure the token you are entering as a password when prompted follows the new format:

    ghp for GitHub personal access tokens

    And make sure you are not creating a "fined-grained" PAT (Personal Access Token), as such token might be too limited in scope and would not work with a specific repository.
    Try and create a classic PAT.