To install brew on Mac OS M series Chips

  1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Press enter for installing brew
  3. brew help if it shows zsh: command not found: brew
  4. cdls ⇒ if you don’t see .zshrc file then create a new one
  5. brew is installed in this directory ls /opt/homebrew/bin ⇒ brew
  6. to add brew nano .zshrc
  7. in the .zshrc file export PATH=”/opt/homebrew/bin:$PATH”
  8. then control + x → Y → enter
  9. ls -al
  10. cat .zshrc will show you the content of that file
  11. source .zshrc (loads the binary path to current terminal)
  12. brew -v to see the version

To install git on macOS

  1. $ brew install git
  2. git -version