Mac OSX に git をインストールする (Homebrew を使用)

Mac OSX に git をインストールする。
正確に言うと、バージョン管理ツールを使用せずにインストールされた git を Homebrew を使って更新する。

環境

Mac OS


$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.8.4
BuildVersion: 12E3067

インストール済の git


$ git --version
git version 1.7.12.4 (Apple Git-37)

インストール方法を確認する

他にもいろいろあるんだろうな。

brew でインストールする *3


$ brew install git

==> Downloading http://git-core.googlecode.com/files/git-1.8.3.3.tar.gz
######################################################################## 100.0%
==> make prefix=/usr/local/Cellar/git/1.8.3.3 CC=cc CFLAGS= LDFLAGS= install
==> make CC=cc CFLAGS= LDFLAGS=
==> make clean
==> make CC=cc CFLAGS= LDFLAGS=
==> Downloading http://git-core.googlecode.com/files/git-manpages-1.8.3.3.tar.gz
######################################################################## 100.0%
==> Downloading http://git-core.googlecode.com/files/git-htmldocs-1.8.3.3.tar.gz
######################################################################## 100.0%
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain

The 'contrib' directory has been installed to:
/usr/local/share/git-core/contrib

Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
/usr/local/Cellar/git/1.8.3.3: 1326 files, 29M, built in 58 seconds

インストール結果を確認する


$ git --version
git version 1.8.3.3


$ which git
/usr/local/bin/git

アンインストール方法もメモしておく


brew uninstall git