我的电脑改了个人用户名或者是密码的时候,git命令不能使用,然后找了很多文章后,才弄好,所以过程写下来
git操作及fatal: Authentication failed for错误解决:
1、配置用户信息
git config --global user.name [username]
git config --global user.email [email]
2、查询用户信息
git config --list
3. 输入命令:
git config --system --unset credential.helper
这样pull 的时候会弹出输入用户名密码,如果pull的时候没有弹出,参考下一步:
4. 如果不行:
找到git安装路劲:C:\Program Files\Git\mingw64\etc gitconfig 打开去掉:helper = manager
这样pull 的时候会弹出输入用户名密码
git 密钥生成:C:\Users\zdf\.ssh 下面有没有id_rsa.pub id_rsa两个文件
git Bash 打开:
$ ssh-keygen -t rsa -C "your_email@example.com"
生成密钥C:\Users\zdf\.ssh
拷贝 id_rsa.pub 文件的内容 添加 SSH key
不需要每次pull都输入用户名:
C:\Users\v_zdfzhang .gitconfig 文件:
[user]
name = zdf
password = 123
email = zdf@123
[credential]
helper=store
加入上面这两行