git跳过用户名和密码验证

$ git config credential.helper store
$ git push https://github.com/repo.git(你的git仓库地址)

Username for 'https://github.com': <USERNAME>
Password for 'https://USERNAME@github.com': <PASSWORD>

如果是在其他电脑上使用,还可以使用缓存期进行设置到期时间

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

单位是秒,7200秒(2个小时)后失效

原文地址:https://www.cnblogs.com/ikai/p/12867713.html