美文网首页
Mac Sourcetree鉴权失败、无法提交

Mac Sourcetree鉴权失败、无法提交

作者: 木马不在转 | 来源:发表于2021-04-12 14:11 被阅读0次

Sourcetree出现鉴权失败,无法提交或无法克隆远程库,多半是更改了账号,需要重新设置ssh配置

1.先终端cdssh文件
cd ~/.ssh
2.在删除ssh文件夹里所以文件
3.再次重新设置邮箱
ssh-keygen -t rsa -C "xxxxxxx@qq.com"

然后一直回车

Enter file in which to save the key (/Users/jackMac/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/jackMac/.ssh/id_rsa.
Your public key has been saved in /Users/jackMac/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:s9ObNgKycNZkCLdbMOtkdDxWl4DQEws5jBmu0TyOa0A xxxxxxx@qq.com
The key's randomart image is:
+---[RSA 3072]----+
|  .=o=.+o...     |
| ++ O.O. ..      |
|.E=+ X.o         |
|.= .* +          |
|+ .+ *  S        |
|... * o  +       |
|.. + o .o .      |
|.   .   ..oo     |
|         oo.     |
+----[SHA256]-----+
4.输入命令copy公钥,在gitlabe上配置好ssh
cat id_rsa.pub
5.最后一步就是顺便克隆一个项目创建known_hosts文件
git clone git@git.xxx.com:xxx/xxxx.git 
ssh

最后在Sourcetree提交代码或克隆就正常了。
如果还出现提示异常你在吧Sourcetree的缓存密码删除重新提交看看

Sourcetree

相关文章

网友评论

      本文标题:Mac Sourcetree鉴权失败、无法提交

      本文链接:https://www.haomeiwen.com/subject/jbhxlltx.html