Skip to content

Instantly share code, notes, and snippets.

@curious-eyes
Last active September 14, 2019 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curious-eyes/20115995c2bd2a27577dcb39ba1f3941 to your computer and use it in GitHub Desktop.
Save curious-eyes/20115995c2bd2a27577dcb39ba1f3941 to your computer and use it in GitHub Desktop.

Git最新版をCentOS7に載せる手順

https://git-scm.com で最新バージョンを確認しておく。

一旦、既存のGitをアンインストールする

  $ sudo yum -y remove git

必要なライブラリをインストール

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

最新バージョンが 2.23.0 の場合

  $ cd /etc/yum.repos.d/
  $ sudo wget https://www.kernel.org/pub/software/scm/git/git-2.23.0.tar.gz
  $ sudo tar xzvf git-2.23.0.tar.gz
  $ cd git-2.23.0/
  $ sudo make prefix=/usr/local all
  $ sudo make prefix=/usr/local install
  $ git --version
  git version 2.23.0

以下、不要なファイルを削除

  $ cd ..
  $ sudo rm -f git-2.23.0.tar.gz
  $ sudo rm -rf git-2.23.0/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment