1. Problems that arise
brew install rabbitmq
fatal: not in a git directory Error: Command failed with exit 128: git, as shown below
2. Solution
Enter brew -v
View information
Execute the following two commands respectively
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
Then reinstall to solve the problem.