MacOS上安装Git的两种方法:homebrew 和 Xcode
2018-11-07 09:49
232 查看
有两种安装Git的方法:
1. 先安装homebrew(点击),再通过它安装Git。
(1)在Mac终端(Terminal)中输入命令:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
按回车等待它自己安装就可以了,安装时间会较长,请耐心等待。
(2)检查是否安装成功,在Terminal中输入命令:
brew
如果出现这样的页面,证明homebrew安装成功。
(3)安装Git,在Terminal中输入命令:
brew install git
接着就是再次耐心地⌛️等待了🍺🍺
2. 通过Xcode安装Git
(1)安装Xcode从App Store安装Xcode(Apple官方IDE,功能非常强大)。Xcode集成了Git,不过没有默认安装,需要手动安装Command Line Tools。
(2)安装Command Line Tools:在Mac终端(Terminal)中输入命令:
xcode-select --install
根据提示进行安装。
(3)检查是否安装成功,重新在Terminal中输入
xcode-select --install
此时它会提醒你:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
证明安装成功。PS:具体操作也可参考Micky米写的Xcode中Command Line Tools安装方法。
相关文章推荐
- macos安装xcode command line tool的两种方法
- GitHub常用上传文件的两种方法 附带常见的问题及Git安装教程
- centos下两种方法安装git
- centos下两种方法安装git
- centos下两种方法安装git
- centos下两种方法安装git--转载
- centos下两种方法安装git
- MacOS安装homebrew搭建Git环境
- centos下两种方法安装git
- centos下两种方法安装git
- centos下两种方法安装git
- Linux下安装软件的两种方法
- 安装git最快速方法
- Eclipse中SVN的安装步骤(两种)和使用方法
- APK文件安装的两种方法
- Ubuntu 10.04 硬盘安装的两种方法
- [Android]实现静默安装APK的两种方法
- 【摘录】Android实现静默安装APK的两种方法
- Windows 下安装 Ubuntu 7.10 的两种方法
- 虚拟机工具安装两种方法