参考:
问题一:
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.
问题二:
参考:
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配置正确: