首页 > 其他 > 详细

记Git保存本地密码与删除本地缓存

时间:2018-07-24 18:41:42      阅读:212      评论:0      收藏:0      [点我收藏+]

参考:

https://www.jianshu.com/p/77b0340a02f3

https://blog.csdn.net/yunlong782/article/details/50887833?locationNum=7&fps=1


保存密码

 

 git 有三种策略查找用户名密码:去缓存中找,去磁盘中找,去钥匙串中找。

 ~/User/用户名/.gitconfig  中配置了Git查找密码的策略。cache/store/osxkeychain 分别对应上方三个策略

配置 Git 使用磁盘策略(可选参数 cache/store/osxkeychain

 Window 系统下添加环境变量 %HOME% 指向任意目录,将会在指定目录下创建相关文件

 .gitconfig 文件中保存 Git 使用策略,.git-credentials 文件保存对应 URL 使用的帐号密码

 git  config --global  credential.helper  store 

 

 配置帐号密码

 $ git config --global user.name "xxxxxx"
 $ git config --global user.email "xxxx@.com"

 


 

删除本地缓存

 //查找系统支持的策略方式

 git help -a | grep credential 

 // credential.helper 字段中配置的即为 Git 查找策略
 //查找 Git 的全局配置

 git config --list 



 //查看目前 Git 使用的策略
 git config credential.helper

 //查看目前 Git 使用的策略所在目录,找到后可以直接删除
 git config --show-origin --get credential.helper 

 删除后参照保存本地密码可以再次设置 Git 查找策略与帐号密码

 

 

记Git保存本地密码与删除本地缓存

原文:https://www.cnblogs.com/Z-onee/p/9361817.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!