miseでPythonがインストールできない問題を解決した

小ネタです。

mise install python@3.12.11 を実行したところ以下のエラーが発生

mise ERROR git branch --show-current failed
mise ERROR command ["git", "-C", "/Users/kimihito/Library/Caches/mise/python/pyenv", "-c", "safe.directory=/Users/kimihito/Library/Caches/mise/python/pyenv", "branch", "--show-current"] exited with code 128

「pyenvなんて使ってないけどなぁ」と思いつつmiseのIssueを検索。すると似たような問題に遭遇している人を発見。

github.com

ここのコメント にあったように

$ mise cache clear
$ mise cache prune

を実行した後に再度 mise install python@3.12.11 を実行するとうまくいった。