当前位置:   article > 正文

解决使用git clone和push时每次都需要输入用户名和密码的烦恼_git clone 每次都得输入用户名

git clone 每次都得输入用户名

1. SSH免密方式

使用git bash ssh-keygen或puttygen.exe生成公钥。

2. 配置全局开机存储认证信息

下面命令会将下次弹框的账号和密码保存起来,永久使用。
git config --global credential.helper store

如果想要清除该账号和密码,使用如下命令:
git config --global credential.helper reset

想要临时存储(默认15min),使用如下命令
git config --global credential.helper cache

windows下的临时存储命令不是上面的,应该使用下面的命令
git config --global credential.helper wincred

3. 地址中携带用户信息

在https链接里加入username:password。
git remote add origin https://username:password@xxx.git 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/758247
推荐阅读
相关标签
  

闽ICP备14008679号