CentOS安装git命令:yum install -y git
Debian或Ubuntu Linux安装:sudo apt-get install git
mac安装:brew install git #brew需要单装
*附上一个官方原版的方式:https://git-scm.com/download/linux
It is easiest to install Git on Linux using the preferred package manager of your Linux distribution.
$ apt-get install git
$ yum install git
(up to Fedora 21)$ dnf install git
(Fedora 22 and later)
$ emerge --ask --verbose dev-vcs/git
$ pacman -S git
$ zypper install git
$ cd /usr/ports/devel/git
$ make install
$ pkg install developer/versioning/git
$ pkg_add git
root@zk ~]# yum install -y git #linux 或 zhangkai@bogon ~ brew install git #mac os
安装完成过之后:
# git config --global user.name "Your Name" # git config --global user.email "email@example.com"
然后查看git版本号:
zhangkai@bogon ~ git --version git version 2.7.0
原文:http://www.cnblogs.com/allan-king/p/5413582.html