LoginSignup
2
0

More than 5 years have passed since last update.

gitの最新版をinstallしたい

Last updated at Posted at 2016-09-17

やりたいこと

  1. gitの最新版をinstallすること

yumでinstallする場合


$ sudo yum list | grep git

# 略
git.x86_64                                 1.8.3.1-6.el7_2.1           updates  

1.8系しか入らないけど最新の2系を入れたい。

wgetでソースからinstallする

準備 : perl-ExtUtils-MakeMakerを事前にインストールする
最新版 : 2016/9/17現在の最新版は2.10.0

以下で確認
https://www.kernel.org/pub/software/scm/git/

$ sudo yum install -y perl-ExtUtils-MakeMaker
$ sudo wget https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz


    CC http-push.o
http-push.c:18:19: 致命的エラー: expat.h: そのようなファイルやディレクトリはありません
 #include <expat.h>
                   ^
コンパイルを停止しました。

エラーにぶつかる。
調べると expat-develをインストールしていくと良いらしい


$ sudo yum install -y expat-devel
# もう一回やり直し
$ sudo wget https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz

# 確認
$ which git
/usr/local/bin/git
$ git --version
git version 2.10.0

できた。

参考
CentOS6にGit1.8をコンパイルインストールする方法

2
0
0

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
2
0