gitインストールメモ

投稿者: | 2017-09-17

私的メモ。
[git会準備]MacにHomebrewでgitをインストールする | e2esound.com業務日誌 http://blogged.e2esound.com/2013/07/03/git-kai_how_to_install_git_with_homebrew/
を参考に進めてみた。
・gitのバージョン確認
yukias-MBA:~ yukias$ git –version
git version 1.9.3 (Apple Git-50)
・homebrewのgitの情報確認
yukias-MBA:~ yukias$ brew info git
git: stable 2.2.2 (bottled), HEAD
http://git-scm.com
Not installed
→インストールされてなかった。
yukias-MBA:~ yukias$ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.2.2.y
######################################################################## 100.0%
==> Pouring git-2.2.2.yosemite.bottle.tar.gz
==> Caveats
・・・
==> Summary
/usr/local/Cellar/git/2.2.2: 1357 files, 31M
インストールできた。
再度バージョン確認
yukias-MBA:~ yukias$ git –version
git version 1.9.3 (Apple Git-50)
古いまま。場所を確認
yukias-MBA:~ yukias$ which git
/usr/local/bin/git
Macのgitを見ているみたい。
mac標準ではなくhomebrewのgit1.8〜を使うためにやったこと – Qiita
http://qiita.com/kony/items/ec5758b72f6799f209d3
Macのgitをhomebrewでインストールしたものに変更する – Rock’n’Hack ブログ
http://rock-and-hack.blogspot.com/2012/12/macgithomebrew.html
上記を参考に、パスを変えることにする。
yukias-MBA:~ yukias$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
なんかおかしい。元の設定は、
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
になっているはずなのに。。。
一度ターミナルを再起動する。
yukias-MBA:~ yukias$ git –version
git version 2.2.2
最新バージョンになった。