not in a git directory

执行时 brew install libtool automake autoconf nasm 遇到报错

fatal: not in a git directory

解决方案

  1. 执行 brew -v 查看会有两个提示

brew-v

  1. 根据提示执行

    1
    2
    git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
    git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
  2. 完成以上操作以后执行

    1
    arch -arm64 brew install cocoapods