'is it possible to auto renew the github token

Today when I push the repo to github, shows error like this:

➜  reddwarf-translate-plugin git:(main) git push
Username for 'https://github.com': linus
Password for 'https://[email protected]':
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/jiangxiaoqiang/reddwarf-translate-plugin.git/'

I know the token may expired and I have to replace a new token, I was wonder is it possible to let the git auto renew the github token so that I did not need to care about the token expire or not anymore?



Solution 1:[1]

https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation

When you're generating a new token access, Github allows you to choose the option of 'No expiration', but as said in the docs, GitHub strongly recommends that you set an expiration date for your token to help keep your information secure.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 calebe santana