LoginSignup
7
7

More than 5 years have passed since last update.

HomebrewでインストールしたGitを使用する

Last updated at Posted at 2014-06-12
  • ターミナルで現在のGitのバージョンを確認する
$ git version
git version 1.8.0 (Apple Git-○○)

  • (Apple Git-○○)と出る場合は、Xcodeで利用するGitをターミナルで使用する設定になっています。
  • 今回はこれをHomebrewでインストールしたGitに変更することが目的です。

etc/pathsを書き換えよう!

  1. 現在のパスの内容を確認
  $ cat /etc/paths
  /usr/bin
  /bin
  /usr/sbin
  /sbin
  /usr/local/bin  # brewでインストールしたものはここにリンクがある
  1. pathsの内容を変更する
  $ sudo vi /etc/paths
  /usr/local/bin   # この行を一番上にする
  /usr/bin
  /bin
  /usr/sbin
  /sbin
  1. バージョン確認をすると、brewでインストールしたものGitのバージョンに変わっている
  $ git version
  git version 2.0.0

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7