M2 How to install homebrew
if happen the following
git: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find git 2> /dev/null' failed with exit code 34304: (null) (errno=Invalid argument)
xcode-select: Failed to locate 'git', requesting installation of command line developer tools.
Failed during: git init -q
sudo xcode-select --switch /Library/Developer/CommandLineTools/ first then download again
if you have problem with:

Then have do something first. Setting the PATH
if you are bash then vi ~/.bashrc
If you are zsh then vi ~/.zprofile to access the z-shell, in this file add export PATH="/opt/homebrew/bin:$PATH" then save them (esc +:+wq! )
Now we have to implement the changes run source ~/.zprofile
and then print by echo $PATH. Then you download again.