Sourcetree
出现鉴权失败,无法提交或无法克隆远程库,多半是更改了账号,需要重新设置ssh
配置
1.先终端cd
到ssh
文件
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

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

网友评论