LoginSignup
0
0

More than 3 years have passed since last update.

gitをHomebrewでインストールし直す際のエラー

Last updated at Posted at 2020-07-05

一度gitをインストールしていたが、Homebrewでインストールしておいた方がgit-prompt.shが自動生成される為gitをHomebrew経由で再インストールした話です。
エラーでハマってしまったので自分用メモとして残ります。

インストール済みのgitのディレクトリを削除後、以下のコマンドでgitが存在しないことを確認
(実行後何も表示されなければ存在しません)

 $ which git

以下のコマンドでHomebrewを更新

brew install git

実行後、以下のコマンドを実行し、実行結果が同じであることを確認

$ which git
/usr/local/bin/git

実行結果が異なる場合はパスの設定が以前のままになっている可能性がありますので、以下のコマンドでリンク先を上書きする。
(このリンク設定を忘れエラーにハマりました)

$ brew link --overwrite git

実行後、以下のコマンドを実行し、実行結果が同じであることを確認

$ which git
/usr/local/bin/git
0
0
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
0
0