git push 缓存密码和用户名

时间:2023-03-10 06:39:29
git push 缓存密码和用户名

https://*.com/questions/6565357/git-push-requires-username-and-password

git remote -v

------------------------------------------------

Permanently authenticating with Git repositories

Run the following command to enable credential caching:

$ git config credential.helper store
$ git push https://github.com/owner/repo.git Username for 'https://github.com': <USERNAME>
Password for 'https://USERNAME@github.com': <PASSWORD>

You should also specify caching expire,

git config --global credential.helper 'cache --timeout 7200'

After enabling credential caching, it will be cached for 7200 seconds (2 hour).

git push 缓存密码和用户名