GIT 版本管理工具
Summary: Author: 张亚飞 | Read Time: 1 minute read | Published: 2016-08-08
Filed under
—
Categories:
DevOps
—
Tags:
Linux,
Server,
Software,
DevOps,
今天发现 Ubuntu
新系统居然没有安装 git
- 最简单的方式通过
apt
安装 – 版本较老1.9.2
sudo apt update
sudo apt install git
卸载通过 apt
安装的 git
sudo apt purge git
sudo apt autoremove
- 通过源码编译安装 – 可以安装最新的
git
2.8.2
sudo apt update
sudo apt install build-essential libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip
sudo wget https://github.com/git/git/archive/v2.8.2.zip -O git.zip
unzip git.zip
cd git-*
- 现在,你可以通过以下两条
make
命令打包并安装git
:
make prefix=/usr/local all
sudo make prefix=/usr/local install
// and then ...
git --version
更新 git
- 现在如果已经通过源码编译安装git, 如果你需要更新到
git
最新版本 只需要git clone
并按以上步骤重新编译安装:
git clone https://github.com/git/git.git
...
Comments