02 Git 安装
By Kevin Song
- 02-01 Linux
- 02-02 Mac OS X
- 02-03 Windows
02-01 Linux
- 检验是否已经安装Git
$ git
The program 'git' is currently not installed. You can install it by typing:
sudo apt-get install git
- Debian或Ubuntu Linux下安装Git
sudo apt-get install git
02-02 Mac OS X
方法一
- 安装homebrew
- 通过homebrew安装Git
- 参考homebrew文档
方法二
- 安装Xcode
- 菜单 - Xcode - Preferences - Downloads - Command Line Tools - Install
02-03 Windows
- 下载安装Windows版Git
- Git - Git Bash 打开Git
- 设置名字和Email地址
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
git config命令的–global参数:表示此机器上所有的Git仓库都会使用这个配置