6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

git switch を使うためにHomebrewでGitをインストールした備忘録

Last updated at Posted at 2019-10-01

こちらのツイートを見て、
「やばいやばい、老害になる前に俺も早速 git switch 使うぞ〜^^」
とコマンドを叩くも、そんなコマンド存在しないぞ?と怒られました

もしかして、俺のGitバージョン低すぎ?

git --version

で現在使用しているGitのバージョンを確認できます。

git version 2.20.1 (Apple Git-117)

git switch等はv.2.23.0以降のようなのでバージョンが低いことが分かりました。

GitのWebサイトからダウンロードする方法もりますが、今回はHomebrewを使います。
まだHomebrewを導入していない方はこちらからインストールしましょう→Homebewa

brew update

念の為、Homebrewを最新にしておきます。

brew install git

HomebrewでGitをインストールします。

git --version

インストールが無事に終わったらバージョンを確認します。
あれ?バージョンが変わっていませんでした。
パスの向き先は正常なようです。

あ、Terminalを再起動するの忘れてた!

git version 2.23.0

無事にアップデートでき、 git switch 等のコマンドを叩くことができるようになりました!

6
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
6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?