事情是这样的,因为安装其他软件需要,我在Mac上面安装了Xcode这个庞然大物,安装完成后占用10G空间,然而然而,我的硬盘总共才128G,所以,Xcode这样敌人必除之,哈哈,因为本人不做IOS开发的。
1
2
|
$ du
-
sh Xcode_7.
2_beta_4
.dmg
4.3
GXcode_7.
2_beta_4
.dmg
|
于是,放大招了。
1
|
$ sudo rm
-
rf
/
Applications
/
Xcode.app
|
这之后,运行git,报错了
1
2
|
$ git
xcrun: error: active developer path (
"/Applications/Xcode.app/Contents/Developer/"
) does not exist, use `xcode-select --
switch
path/to/Xcode.app` to specify the Xcode that you wish to use
for
command line developer tools (or see `man xcode-select`)
|
原因是Xcode不存在了。安装一个试试
1
2
|
$ xcode
-
select
-
-
install
xcode
-
select: error: command line tools are already installed, use
"Software Update"
to install updates
|
如是,查看提示后,切换达到另外一个环境OK
1
2
3
4
5
6
7
8
|
$ sudo xcode
-
select
-
-
switch
/
Library
/
Developer
/
CommandLineTools
/
Password:
$ git
usage: git [
-
-
version] [
-
-
help
] [
-
C <path>] [
-
c name
=
value]
[
-
-
exec
-
path[
=
<path>]] [
-
-
html
-
path] [
-
-
man
-
path] [
-
-
info
-
path]
[
-
p |
-
-
paginate |
-
-
no
-
pager] [
-
-
no
-
replace
-
objects] [
-
-
bare]
[
-
-
git
-
dir
=
<path>] [
-
-
work
-
tree
=
<path>] [
-
-
namespace
=
<name>]
<command> [<args>]
|
本文转自it你好 51CTO博客,原文链接:http://blog.51cto.com/itnihao/1716535,如需转载请自行联系原作者