当前位置:   article > 正文

Git fatal: Authentication failed for

Git fatal: Authentication failed for

一、错误

fatal: Authentication failed for

$ git push -u origin master
fatal: Authentication failed for 'https://code.aliyun.com/***/***.git/'
  • 1
  • 2

二、网上的解决方法(个人记录一下)

1.配置邮箱和用户名

$ git config --global --replace-all user.email “输入你的邮箱”
$ git config --global --replace-all user.name “输入你的用户名”

这个方法在mac上确实是行得通的,但是如果是windows 好像不太好使,
我执行之后还是一样的问题!

2.打开控制面板删除凭据
选择用户账户
在这里插入图片描述
管理windows凭据
在这里插入图片描述
然后删除相应的git凭据
在这里插入图片描述
但是这个方法并没有解决我的这个问题!!!

三、错误原因

由于我用的是公司的code.aliyun的账号,然而我并没有生成和配置这个账号的Git公钥

四、解决方法

1、配置账户名和邮箱
$ git config --global --replace-all user.name “输入你的用户名”
或($ git config --global user.name “用户名”)
$ git config --global --replace-all user.email “输入你的邮箱”
或($ git config --global user.email “邮箱”)

2、根据邮箱生成该账号的公钥
ssh-keygen -t rsa -C “邮箱”

3、找到C:/Users/1/.ssh/id_rsa.pub文件
复制id_rsa.pub文件里的内容(公钥)配置到Git账号的公钥即可!

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

闽ICP备14008679号