mac更新系统后git出现的一系列问题

Posted 努力的man

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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命令出错

 Update failed
 XXXXXXX: Permission denied (publickey).
 Could not read from remote repository.
 Please make sure you have the correct access rights
 and the repository exists.

一、问题出现原因

查询资料得知任何运行OpenSSH 8.8 或更新版本的系统默认使用 SHA-1 哈希算法禁用 RSA 签名。之前的命令,不再适用,算法导致旧的RSA签名无效。

二、解决步骤

删除.ssh文件夹重新生成
使用ed25519的算法生成密钥,之后再直接复制密钥去对应的机器。
代码如下:

 ssh-keygen -t ed25519 
 Generating public/private ed25519 key pair.
 Enter file in which to save the key (/Users/nathan15/.ssh/id_ed25519): 
 Created directory \'/Users/nathan15/.ssh\'.
 Enter passphrase (empty for no passphrase): 
 Enter same passphrase again: 
 Your identification has been saved in /Users/nathan15/.ssh/id_ed25519
 Your public key has been saved in /Users/nathan15/.ssh/id_ed25519.pub
 The key fingerprint is:
 SHA256:8i/vdXHhOE5BEDWPWtJFr/Rm8jK6dm43fAlgXQlKKsU nathan15@JNPG67WMJG
 The key\'s randomart image is:
 +--[ED25519 256]--+
 |        .. ++=oo.|
 |        .Eo + =o.|
 |       . . o.=oo.|
 |        .  o+o+o.|
 |      . S ...++.=|
 |       o    o..B |
 |        .   ..* o|
 |        .. ..oo*o|
 |         ++.o=..o|
 +----[SHA256]-----+

在文件夹中是看不到.ssh文件

可以执行此命令查看.ssh文件内容

 cat ~/.ssh/id_ed25519.pub

 
到这里就把mac更新后git出错的问题解决了

mac更新系统后Git不能用,提示missing xcrun at

今天更新了mac系统,然后就踩了这个坑。

启动AndroidStudio 右上角提示:

can‘t start git: /usr/bin/git 
probably the path to git executable is not valid . `fix it`.
  • 1
  • 2

点击fix it后 点击最上边路径地址后边的test提示:

errors while executing git -- version. exitCode=1 
errors: xcrun: error : invalid active developer path(/library/developer/commandlinetools),missing xcrun at:
/library/developer/commandlinetools.usr/bin/xcrun
  • 1
  • 2
  • 3

找了一圈。。很多开发者都遇到过这问题。据说苹果每个版本的更新都会有这样的问题,原因是每次安装新的更新后,Xcode都被卸载了。。。。不扯别的说解决方案。


通过终端重新安装的Xcode命令行工具使用(其实这里安装的是Command Line Tools,Command Line 
Tools是在Xcode中的一款工具)

xcode-select --install

以上是关于mac更新系统后git出现的一系列问题的主要内容,如果未能解决你的问题,请参考以下文章

mac更新后Git无法使用的问题

mac更新后Git无法使用的问题

mac更新系统后Git不能用,提示missing xcrun at

windows使用记录---2019.8月补丁更新后出现windows7系列UEFI无法启动解决办法

mac OS catalina上的git clone命令面临问题[关闭]

MAC OS 更新GIT版本时遇到的问题