To promote security, starting from Aug. 2021, many GitHub operations require use of personal access tokens (PAT).
Generate personal access token
Go to https://github.com/settings/tokens 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.
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.
We need to erase the old token, run the following command:
security delete-internet-password -l github.com
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.
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.
License CC BY-NC-ND 4.0