NOTE: This post is a few years old and may be outdated, but I did just install the following on a new iMac M1 in 2022 and here’s what worked:
First, Git comes installed by default on most Mac and Linux machines.
To check if you have Git installed, open your Terminal and type
Hit return. If you don’t see a Git version follow these instructions to install Git on your computer:
Then configure Git with your email and name:
git config --global user.email "email@example.com"
git config --global user.name "Your Name"
Then install Homebrew (see https://brew.sh/ for more detail, but this will get you there):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
If you are using a new Mac M1 you’ll need to add Homebrew to your PATH so run:
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Then restart your Terminal and run the following commands:
brew install git composer php
brew install wget
Bonus: Generate a 4096 bit SSH key (more secure than 2048 or 1024 bit keys)
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
pbcopy < ~/.ssh/id_rsa.pub
Paste into TextEdit or add a new SSH keys to Github or your hosting dashboard.