mac-git错误:can't start git: /usr/bin/git

参考:

问题一:

can't start git: /usr/bin/git
the path to git executable is probably not valid.
fix it.

解决:

查看Git安装位置

which -a git

mac上默认安装的git安装在

/usr/bin/git

如果有多个Git安装地址,可将指定的Git彻底删除:

cd /usr/bin
sudo rm -rf git*

安装有其他版本的git卸载方式也一样,进入安装目录,需要管理员权限删除。

如果不是管理员会报以下错误:

你的账号 is not in the sudoers file. this incident will be reported.

问题二:

参考:

Mac下git的环境搭建和基本使用

errors while executing git --version. exitcode=1 error:xcrun:
error:invalid active developer path
(/Applications/Xcode_v10.1.app/Contents/Developer),missing xcrun at:
/Applications/Xcode_v10.1.app/Contents/Developer/usr/bin/xcrun

解决:

在终端输入,会安装xcrun
xcode-select --install

//单独安装CommandLineTools
sudo xcode-select --switch /Library/Developer/CommandLineTools

错误三:

Repository test has failed
unable to update url base from redirection 

解决:需要Mac生成添加ssh公钥

ssh-keygen -t rsa -C "邮箱"

//enter
//输入自定义密码
//再次输入自定义密码

cat ~/.ssh/id_rsa.pub
//以下生成的SSH Key添加到GitLab中
sh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU
GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3
Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En
mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx
NrRFi9wrf+M7Q== schacon@agadorlaptop.local

然后将自己的邮箱给Gitlab管理员,分配权限,

最后在自己电脑上进行clone等其他操作了。

android studio中使用Git请确保:

有权限访问仓库:
在这里插入图片描述
Git配置正确:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值