当サイトは、アフィリエイト広告を利用しています

macOSをアップデートしたらgitコマンドが使えなくなった|xcode-select: note: No developer tools were found, requesting install.

mac OSを最新にアップデートしたところ、gitコマンドが実行できなくなりました。
調べてみたらあるあるっぽかったので、今後のためにメモしておきます✍️

macOSをアップデートして起きたこと|git add . が使えない

macOS Sonoma バージョン14.5にアップデートした翌日、git add . を実行したところ下記のメッセージが返ってきて実行できなくなりました。

xcode-select: note: No developer tools were found, requesting install.
If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
See `man xcode-select` for more details.

gitコマンドが使えなくなったので試したこと

とりあえず調べてみたら、$ xcode-select --installを実行すれば良いとの試してみた。

xcode-select: note: install requested for command line developer tools

上記メッセージが返ってきた。再度gitコマンド $ git --version を実行してみる。が、状況変わらず最初と同じメッセージが変えてきました。

xcode-select: note: No developer tools were found, requesting install.
If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
See `man xcode-select` for more details.

これで治る人もいるようなのですが、わたしの場合はダメでした。

対処法(結局これでgitコマンドが使えるようになった)

結局App StoreよりXcodeをインストールしたところ、gitコマンドが使えるようになりました。

Xcodeって意識したことなかったのですが、Appleが提供している統合開発環境(IDE)でApple製端末で使用するアプリを作成する際に使用されるものとのことで、gitを動かすために必要みたいです🤔

macOS Sonomaにアップデートすると、Xcodeのバージョンを15に上げないと起動しなくなるらしい。

反省

今回は事情があって急いでOSアップデートしてしまったのですが、ちゃんと案件と案件の合間に実施しないと焦りますね🥹

今回は簡単に解決できて良かったですが、次からは気をつけよう・・・!

RELATED POST

関連記事

Node.js|バージョンアップ手順
Node.jsをインストールする(for MacBook)