LoginSignup
31
31

More than 5 years have passed since last update.

[Git] CentOS7に最新版のgitをインストール

Last updated at Posted at 2017-08-30

はじめに

CentOSにgityumでインストールすると最新バージョンや2.系がインストールされないので、それらのインストール方法を書いていきます。

下準備

既存のgitのアンインストール

command-line
$ sudo yum remove git 

ライブラリのインストール

command-line
$ sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker autoconf

最新バージョンのインストール

ここでは、現在(2017/8/30)の最新バージョンであるgit-2.9.5をインストールします。

command-line
$ wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
$ tar vfx git-2.9.5.tar.gz
$ cd git-2.9.5
$ make configure
$ ./configure --prefix=/usr
$ make all
$ sudo make install

最後に確認。

command-line
$ git --version

出力がgit version 2.9.5であれば、インストールは完了です。

参考

31
31
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
31