Git记住密码设置
CommentContents
设置git记住密码
1,记住密码设置
进入git目录,执行下面的命令,长期保存账号信息:
1 | git config --global credential.helper store |
或临时记住15分钟:
1 | git config -–global credential.helper cache |
注意:git config配置生效范围
参数 | 描述 | 级别 |
---|---|---|
--system |
表示针对整个系统的全局设置 | 最大范围 |
-–global |
表示针对当前计算机登录的用户的全局设置 | 中等范围 |
--local |
表示针对当前仓库设置 | 最小范围 |
2,查看当前的git配置信息
1 | git config -l |
输出如下:
1 | credential.helper=osxkeychain |
如,需修改当前仓库的某一项,可使用如下方式:
1 | git config --local user.name "soilove4ln" |
清除记住密码的设置
执行如下命令:
1 | git config --global --unset credential.helper |
如果你需要清除其他参数设置,同样的,使用上述方法即可。
- 本文作者:沙果栗子本文链接:https://32e.co/2020/06/15/git-remember-password/版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处!