git をインストールしてみる

% sudo apt-get install git cogito git-core curl
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  libcurl3-gnutls rcs
Suggested packages:
  git-arch git-cvs git-svn git-email git-daemon-run gitk gitweb
Recommended packages:
  gawk git-doc rsync python
The following NEW packages will be installed:
  cogito curl git git-core libcurl3-gnutls rcs
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 3460kB of archives.
After unpacking 8314kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 ftp://ftp.us.debian.org stable/main libcurl3-gnutls 7.15.5-1etch1 [163kB]
Get:2 ftp://ftp.us.debian.org stable/main rcs 5.7-18 [331kB]
Get:3 ftp://ftp.us.debian.org stable/main git-core 1:1.4.4.4-4+etch1 [2341kB]
Get:4 ftp://ftp.us.debian.org stable/main cogito 0.18.2-1 [195kB]                                                      
Get:5 ftp://ftp.us.debian.org stable/main curl 7.15.5-1etch1 [163kB]                                                   
Get:6 ftp://ftp.us.debian.org stable/main git 4.3.20-10 [267kB]                                                        
Fetched 3460kB in 18s (190kB/s)                                                                                        
Selecting previously deselected package libcurl3-gnutls.
(Reading database ... 22840 files and directories currently installed.)
Unpacking libcurl3-gnutls (from .../libcurl3-gnutls_7.15.5-1etch1_i386.deb) ...
Selecting previously deselected package rcs.
Unpacking rcs (from .../archives/rcs_5.7-18_i386.deb) ...
Selecting previously deselected package git-core.
Unpacking git-core (from .../git-core_1%3a1.4.4.4-4+etch1_i386.deb) ...
Selecting previously deselected package cogito.
Unpacking cogito (from .../cogito_0.18.2-1_all.deb) ...
Selecting previously deselected package curl.
Unpacking curl (from .../curl_7.15.5-1etch1_i386.deb) ...
Selecting previously deselected package git.
Unpacking git (from .../git_4.3.20-10_i386.deb) ...
Setting up libcurl3-gnutls (7.15.5-1etch1) ...

Setting up rcs (5.7-18) ...
Setting up git-core (1.4.4.4-4+etch1) ...

Setting up cogito (0.18.2-1) ...
Setting up curl (7.15.5-1etch1) ...
Setting up git (4.3.20-10) ...

git のバージョンを表示できない

git のバージョンを表示させようとすると、下記のメッセージが表示される。

% git --version

git, the filemanager with GNU Interactive Tools, is now called gitfm.

If you are looking for git, Linus Torvald's content tracker, install
the cogito and git-core packages and see README.Debian and git(7).

This transition script will be removed in the debian stable
release after etch.

If you wish to complete the transition early, install git-core
and use (as root):
 update-alternatives --config git

Press RETURN to run gitfm

/usr/bin/gitfm: invalid option -- -

メッセージの要約は、

  1. Linus Torvald のバージョン管理ソフトを利用したいのならば、apt-get install cogito git-core をインストールする
    If you are looking for git, Linus Torvald's content tracker, install the cogito and git-core packages
  2. この移行スクリプトDebianetch 以降の安定版で削除される
    This transition script will be removed in the debian stable release after etch.
  3. 完全に移行をしたいのなら、git-core をインストール後、sudo update-alternatives --config git を実行する
    If you wish to complete the transition early, install git-core and use (as root): update-alternatives --config git

とあるので、指示通りに進めてみる。

% sudo update-alternatives --config git
Password:

There are 2 alternatives which provide `git'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/git-scm
*+        2    /usr/bin/git.transition

Press enter to keep the default[*], or type selection number: 1
Using `/usr/bin/git.transition' to provide `git'.

ここで選択を迫られるので、

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/git-scm
*+        2    /usr/bin/git.transition

Press enter to keep the default[*], or type selection number:

/usr/bin/git-scm を選択する。なので、1 を入力する。
そして、バージョンを確認してみる。

% git --version
git version 1.4.4.4

バージョンは 1.4.4.4 ですか。マニュアルはすでに 1.5.3 以降になっているのに。