Cannot connect to Github using personal access token



I'm a novice user of Phpstorm and Github, but have been able to clone my repo and push updates just fine until the changeover to using personal access tokens to authenticate the Git connection.


I have generated a PAT, have successfully added it to settings>version control>Github

without error, but every time I try to clone my repo I get a Github pop-up that does not accept any combination of my username/email/github password or PAT as password. I'm at the end of my rope and need some help here.

Comment actions Permalink

Hello Chandra Krishnan
Could you please share exact error message/ screenshot of an error?

Comment actions Permalink

Having the same issue now. Every "git pull" from the command line meets with a password request, which will never work as it's been disabled for a year:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see for more information.
fatal: Authentication failed for '{repo}.git/'

My PAT expired yesterday so I regenerated it. I tried first to update it in the Keychain and met the above behaviour. Then used the PHPStorm interface to update the PAT. Same error. Then changed options to store the token in KeePass instead of Keychain. Same. Ticked and unticked the "Use credential helper". Same.

MacOS Big Sur 11.6.5 (20G527)
PhpStorm 2021.3.2
Build #PS-213.6777.58, built on January 31, 2022

Comment actions Permalink

Found the solution.

Even though PHPStorm / IntelliJ appears to be asking for the GitHub account credentials, in fact it is asking for the PAT.

Entering the GitHub account's email in the "Username" field, and the token in the "Password" field is what is required to make it work correctly.


Please sign in to leave a comment.