mac 初期設定 part4 - Gitをインストール

概要

Homebrewがインストールできたら続いて、HomebrewでGitをインストールします。

Git をインストールする

ターミナルで以下を入力。

$ brew install git

下のような表示が出たら完了。らくちんですね^^

==> Summary
 🍺  /usr/local/Cellar/git/1.8.5.3: 1335 files, 29M

brew doctor でインストール内容の確認

ターミナルで以下を入力。

$ brew doctor

するとこのような警告が出てきました。

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
    git
    git-cvsserver
    git-receive-pack
    git-shell
    git-upload-archive
    git-upload-pack
Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

「.bash_profile」にPATHを設定しなさい!ってことみたいです。
「.bash_profile」にPATHを通して有効化します。

$ echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile
$ source .bash_profile

最後にもう一度 $ brew doctor で問題なければ完了です!

投稿日:

ページのトップへ戻る