怎样删除Git中缓存的用户名和密码
作者:小破孩呦 时间:2023-08-12 23:56:55
删除Git缓存的用户名和密码
昨天在上传代码的时候提示输入用户名密码,结果输错了3次就没有提示框了,就一直报错(身份验证失败),没办法提交代。
在使用git的过程中,我们也会经常遇到以前保存在git的用户名密码忘记了,或者不用了。
在公司也可能遇到保存了用户名和密码的同事离职,换成新来的员工。
在这些情况下,我们就要清除掉保存在git中的用户名和密码,重新缓存。
运行一下命令缓存输入的用户名和密码
git config --global credential.helper wincred
清除掉缓存在git中的用户名和密码
git credential-manager uninstall
Windows也可以如下操作删除
控制面板\用户帐户\凭据管理器
删除对应版本库的用户名密码
Git配置、缓存用户名密码和清除缓存
只要是加-- global的都是设置全局的,建议不要这样设置。
下面的所有的操作都是编辑的 .git/config的内容,也可以找到这个文件,直接添加内容。
1.配置用户名和邮箱,分为全局和项目两种:
1)此处内容为全局设置用户名和邮箱
git config --global user.name "username"
git config --global user.email "useremail@qq.com"
2)此处为单个项目设置用户名和密码
git config user.name "username"
git config user.email "useremail@qq.com"
2.清除配置中纪录的用户名和密码,下次提交代码时会让重新输入账号密码
git config --system --unset credential.helper
3.执行下面命令之后,再次pull或push时会缓存输入的用户名和密码
git config --global credential.helper store #全局
git config credential.helper store #单个项目
4.清除git缓存中的用户名的密码
git credential-manager uninstall
#如果电脑是macos提示 git: 'credential-wincred' is not a git command. See 'git --help'
#第一步:git config --unset-all credential.helper
#第二步:git config --global credential.helper osxkeychain
来源:https://xiaopohai.blog.csdn.net/article/details/83658964
标签:Git,缓存,用户名,密码
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Vue + iView实现Excel上传功能的完整代码
2024-05-29 22:43:13
![](https://img.aspxhome.com/file/2023/5/123045_0s.png)
Python通过命令开启http.server服务器的方法
2022-10-08 01:42:41
python性能测试手机号验证码登录压测示例详解
2021-06-05 13:21:25
vue2.0+vue-dplayer实现hls播放的示例
2024-05-29 22:46:56
![](https://img.aspxhome.com/file/2023/2/123002_0s.png)
python:print格式化输出到文件的实例
2023-08-25 06:40:53
探讨链接打开方式
2009-03-16 16:55:00
![](https://img.aspxhome.com/file/UploadPic/20093/16/1-401x230-94s.jpg)
Python简单实现自动删除目录下空文件夹的方法
2021-07-28 20:28:39
Python OpenCV图像模糊处理介绍
2023-05-20 14:20:17
![](https://img.aspxhome.com/file/2023/5/75135_0s.png)
asp用err.raise自定义错误信息
2007-09-12 19:38:00
Pycharm安装第三方库时Non-zero exit code错误解决办法
2023-03-15 12:15:01
![](https://img.aspxhome.com/file/2023/2/121732_0s.png)
Linux下python制作名片示例
2022-06-07 00:29:33
![](https://img.aspxhome.com/file/2023/1/99471_0s.png)
一个基于flask的web应用诞生(1)
2022-06-22 09:23:52
![](https://img.aspxhome.com/file/2023/5/127925_0s.png)
php floor()函数案例详解
2023-06-14 16:13:03
学习ASP的理由 分析小结
2011-02-26 10:54:00
python redis连接 有序集合去重的代码
2023-10-23 21:24:32
python连接mysql调用存储过程示例
2024-01-18 01:32:19
vue项目base64字符串转图片的实现代码
2024-04-30 10:21:46
![](https://img.aspxhome.com/file/2023/8/130258_0s.png)
python处理文本文件并生成指定格式的文件
2021-05-16 15:43:42
详解python中的IO操作方法
2023-08-29 22:16:16
![](https://img.aspxhome.com/file/2023/9/123669_0s.png)
详解Python如何轻松实现定时执行任务
2022-02-02 16:44:42
![](https://img.aspxhome.com/file/2023/5/88995_0s.png)