LoginSignup
1
1

More than 3 years have passed since last update.

HomebrewでインストールしたGitのバージョンアップ方法 【Mac】

Last updated at Posted at 2020-04-20

Gitのバージョン確認

$ git --version
$ git --version
git version 2.26.0

HomebrewでGitをインストールしている場合

$ brew update && brew upgrade git

Gitのバージョンが切り替わらない場合

$ which git
/usr/bin/git

HomebrewでインストールしたGitを使うように指定

.bash_profile.zshrcに以下を書き込む

export PATH=/usr/local/bin:$PATH
$ which git
/usr/local/bin/git

HomebrewでGitをインストールしていない場合

Homebrewをインストールする

以下をターミナルに貼り付けて、実行

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

HomebrewでGitをインストールする

$ brew install git

HomebrewでインストールしたGitを使うように指定

$ which git
/usr/bin/git

.bash_profile.zshrcに以下を書き込む

export PATH=/usr/local/bin:$PATH
$ which git
/usr/local/bin/git

$ git --version
git version 2.26.1
1
1
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
1
1