LoginSignup
8
6

More than 3 years have passed since last update.

MacOSをアップデートしたらGitでエラーが発生した

Last updated at Posted at 2019-07-18

VSCodeでエラー発生

VSCodeでGitを使おうと思ったら、エラーが表示されていました。

Git not found. Install it or configure it using the 'git.path' setting.

Gitが見つからないらしいですが、以前から使用できていたのでおかしい。
下記のコマンドで実行できるか試してみると、新たなエラーが表示されました。

$ git --version
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

エラーの対応

調べてみると、MacOSをアップデートした後に発生するエラーのようです。
下記の記事を参考にxcodeをインストールだけでエラーがなくなりました!
High Sierraへアップデート後のgitエラー

xcodeをインストール。

$ xcode-select --install

インストールが完了したらgitを確認。

$ git --version
git version 2.20.1 (Apple Git-117)

終わりに

xcodeは以前から使用していなかったんですが、なぜエラーが起きたのか謎です。。。

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