Gitのインストール

apt, apt-get

普通の人は
最新の Git でなければダメ… とか,
configure でいろいろカスタムしたい…
という状況にはならないので,apt で十分.

sudo apt install git

ソースからビルド

なんとなくソースを使ってインストールしたかった場合.
事前に必要なものをインストールしておく.

sudo apt install autoconf asciidoc

zlibのインストールも必要だった.
次に,GitHub のソースから clone してくるか,適当なバージョンの *.tar.gz などを持ってくるかして,ローカル環境にダウンロードする.
当然 clone をするにはGitがインストールされている必要がある.

  • GitHubから
    # リポジトリがローカル環境にないときは
    git clone git://git.kernel.org/pub/scm/git/git.git
    # git clone https://github.com/git/git
    cd git
    # リポジトリがあるときは
    git fetch
    リポジトリを更新したら,最新バージョンのタグに checkout する.
    git checkout v2.18.0
  • アーカイブから(例)
    wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
    tar -zxf git-2.18.0.tar.gz
    cd git-2.18.0

あとはいつもの.初期状態では configure がないので make configure で configure ファイルをつくる.

make configure
./configure --prefix=/usr/local --with-curl
make all
sudo make install

README を読むと configure を使わなくてもできるらしい.
ただし,--with-curl をつけて ./configure をしないと,git clone で

$ git clone https://github.com/hogehoge/foobar
fatal: Unable to find remote helper for 'https'

となり https 等から一切 clone ができなかった.


Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2019-08-24 (Sat) 06:27:15 (1700d)