mac更新系统后git出现的一系列问题
1.xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
1.解决方法:
打开命令终端运行 xcode-select --install 回车后,系统弹出下载xcode组件,点击确认,下载完成后即可。 mac中很多软件都需要依赖xcode的先关组件。
2.Please make sure you have the correct access rights;git 报 Permission denied (publickey).
终端执行git pull,git push命令出错
1 Update failed 2 XXXXXXX: Permission denied (publickey). 3 Could not read from remote repository. 4 Please make sure you have the correct access rights 5 and the repository exists.
一、问题出现原因
查询资料得知任何运行OpenSSH 8.8 或更新版本的系统默认使用 SHA-1 哈希算法禁用 RSA 签名。之前的命令,不再适用,算法导致旧的RSA签名无效。
二、解决步骤
删除.ssh文件夹重新生成
使用ed25519的算法生成密钥,之后再直接复制密钥去对应的机器。
代码如下:
1 ssh-keygen -t ed25519 2 Generating public/private ed25519 key pair. 3 Enter file in which to save the key (/Users/nathan15/.ssh/id_ed25519): 4 Created directory '/Users/nathan15/.ssh'. 5 Enter passphrase (empty for no passphrase): 6 Enter same passphrase again: 7 Your identification has been saved in /Users/nathan15/.ssh/id_ed25519 8 Your public key has been saved in /Users/nathan15/.ssh/id_ed25519.pub 9 The key fingerprint is: 10 SHA256:8i/vdXHhOE5BEDWPWtJFr/Rm8jK6dm43fAlgXQlKKsU nathan15@JNPG67WMJG 11 The key's randomart image is: 12 +--[ED25519 256]--+ 13 | .. ++=oo.| 14 | .Eo + =o.| 15 | . . o.=oo.| 16 | . o+o+o.| 17 | . S ...++.=| 18 | o o..B | 19 | . ..* o| 20 | .. ..oo*o| 21 | ++.o=..o| 22 +----[SHA256]-----+
在文件夹中是看不到.ssh文件
可以执行此命令查看.ssh文件内容
1 cat ~/.ssh/id_ed25519.pub
到这里就把mac更新后git出错的问题解决了