安装git
- Linux服务器安装git
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
Download for Linux and Unix
It is easiest to install Git on Linux using the preferred package manager of your Linux distribution.
Debian/Ubuntu
$ apt-get install git
Fedora
$ yum install git
(up to Fedora 21)$ dnf install git
(Fedora 22 and later)
Gentoo
$ emerge --ask --verbose dev-vcs/git
Arch Linux
$ pacman -S git
openSUSE
$ zypper install git
FreeBSD
$ cd /usr/ports/devel/git
$ make install
Solaris 11 Express
$ pkg install developer/versioning/git
OpenBSD
$ 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