To promote security, starting from Aug. 2021, many GitHub operations require use of personal access tokens (PAT).

Generate personal access token

Go to and click Generate new token. Follow the guidelines. Usually the token will expire after the specified time, unless you make it a permanent token, which is not advised by GitHub.

After this, when you push to your GitHub repo, the password you use will be the token generated.

Update tokens

After an old token expires, we need to generate a new token. Then we need to remove the old token and use the new token. The process may vary based on your system.


command line

We need to erase the old token, run the following command:

security delete-internet-password -l

Then run your git operation as usual and you will be prompted to enter your new token. Once your new token is entered and verified, it will be updated to the Keychain app automatically.

Keychain app

You may also directly update the token via the Keychain Access app. Open the app and search for github. Then open the searched item for github and directly update your access token there.