MacBook に git を入れたい。
「入門 git」(Travis Swicegood 著) の「2.1 Git のインストール」には
Mac OS X を愛用している人で、パッケージマネージャを使いたいなら、比較的新しめの Git のコピーが MacPorts にある
とある。MacPorts は先程インストールしたので、本の通りに git をインストールしてみた。
コマンド一つで入るので便利。
$ sudo port install git-core +svn +doc


MacPorts 詳解
MacPorts で git をインストールする方法を書いたエントリーがあった。
ぼくは MacPorts 初心者なので、このエントリーは参考になった。せっかくなので後追いをしてみる。
Git port を探す
port search コマンドを使う。
$ port search git
ardour2 @2.8.2 (audio, x11)
Ardour is a digital audio workstation.
cgit @0.8.2.1 (www, devel)
A fast web interface for the git source code management system
dcraw @8.98-20090919011100 (graphics)
Digital camera raw photo decoding software supporting hundreds of cameras
exiftags @1.00 (graphics)
Utility spits out Exif tags from a digital camera JPEG file
ffmpeg-devel @19824 (multimedia)
Digital VCR and streaming server (new unstable API/ABI libavcodec version 52)
freehdl @0.0.7 (science, math)
A free VHDL simulator used for digital simulations by qucs
gc-utils @0.2.3 (devel)
scripts for interacting with CVS repositories using git
giggle @0.4 (devel)
Git gtk frontend
git-core @1.6.4.4 (devel)
A fast version control system
GitX @0.7.1 (devel)
GitX is a git GUI specifically for Mac OS X
irsim @9.7.71 (science)
IRSIM, a switch level simulator for digital circuits
libgphoto2 @2.4.4 (devel)
The gphoto2 digital camera library
libptp2 @1.1.10 (devel)
libptp2 is a library used to communicate with PTP devices like digital cameras.
orrery @0.9.5 (science, graphics, x11)
A digital model of the solar system within Geomview
photopc @3.05 (multimedia)
Download photos from some older digital cameras
qgit @2.2 (devel)
A graphical interface to git repositories
stgit @0.14.3 (devel, python)
Push/pop utility on top of GIT
tig @0.14 (devel)
A text interface to git repositories
xclock @1.0.4 (x11)
Analog/digital clock for X11
Found 19 ports.
19 の port が見つかった。数が多すぎて、ターミナルを大きくスクロールしてしまう。
--line オプションでコンパクトに表示する。
% port search --line git
ardour2 2.8.2 audio x11 Ardour is a digital audio workstation.
cgit 0.8.2.1 www devel A fast web interface for the git source code management system
dcraw 8.98-20090919011100 graphics Digital camera raw photo decoding software supporting hundreds of cameras
exiftags 1.00 graphics Utility spits out Exif tags from a digital camera JPEG file
ffmpeg-devel 19824 multimedia Digital VCR and streaming server (new unstable API/ABI libavcodec version 52)
freehdl 0.0.7 science math A free VHDL simulator used for digital simulations by qucs
gc-utils 0.2.3 devel scripts for interacting with CVS repositories using git
giggle 0.4 devel Git gtk frontend
git-core 1.6.4.4 devel A fast version control system
GitX 0.7.1 devel GitX is a git GUI specifically for Mac OS X
irsim 9.7.71 science IRSIM, a switch level simulator for digital circuits
libgphoto2 2.4.4 devel The gphoto2 digital camera library
libptp2 1.1.10 devel libptp2 is a library used to communicate with PTP devices like digital cameras.
orrery 0.9.5 science graphics x11 A digital model of the solar system within Geomview
photopc 3.05 multimedia Download photos from some older digital cameras
qgit 2.2 devel A graphical interface to git repositories
stgit 0.14.3 devel python Push/pop utility on top of GIT
tig 0.14 devel A text interface to git repositories
xclock 1.0.4 x11 Analog/digital clock for X11
git-core が目指す port と分かる。
variant を調べる
port variants コマンドを使う。variant はコンパイル (インストール) オプションのやうなもの。
$ port variants git-core
git-core has the variants:
bash_completion: Completion support for bash
[+]doc: Install HTML and plaintext documentation
gitweb: Install gitweb.cgi
svn: Bi-directional subversion repository support
4 つの variant がある。今回は doc と svn を一緒にインストールする。
port のインストール
port install コマンドを使う。variant は +VARIANT_NAME という書式で追記する。
$ sudo port install git-core +doc +svn
インストールが終わったら確認。
$ git --version
git version 1.6.4.4
ちゃんとインストールできた。