Linux 二进制包安装

  • Debian/Ubuntu
$ sudo apt install git
  • Gentoo
$ sudo emerge dev-util/git
  • Fedora/CentOS
# up to Fedora 21
$ sudo yum install git
# Fedora 22 and later
$ dnf install git
  • Arch Linux
$ pacman -S git

Linux 源码包安装

  1. 获取源码 https://mirrors.edge.kernel.org/pub/software/scm/git/
  2. 下载 wget or curl
  3. 解压 tar -zxvf git.tar.gz
  4. 切换目录 cd ./git
  5. 源码安装流程
$ cd ./git
# 个人使用默认安装位置
$ ./configure
# 共用指定安装位置
$ ./configure --prefix=/usr/local
$ make all
$ make install

Windows 安装 Git

  1. 获取安装包 https://git-scm.com/downloads
  2. Windows 软件安装流程
  3. 关闭 Windows 系统下的 autocrlf:git config --global core.autocrlf false
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄