うにてぃブログ

主にUnityとC#に関する記事を書いていきます

【Unity】Cannot perform upm operation: Unable to add package [http://github.com/hoge/hoge.git]:

Mac から Unity の PackageManager で githubリポジトリを追加してみたところ

f:id:hacchi_man:20201114015156p:plain

エラーが発生してしまい、リポジトリを追加できませんでした

Cannot perform upm operation: Unable to add package [http://github.com/yayorozu/UnityCustomInspector.git]:
  Error when executing git command. xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
 [NotFound].See console for more details
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:332)

つまりは コマンドラインツールがインストールされておらず、git のコマンドを実行できないとのことなので

コマンドラインツールをインストールすることで解決できる

$ xcode-select --install