Setup GitHub
Setting up GitHub is straight forward in MacOS. Make sure you installed the git client, either with XCode Command-line tools or with brew.
Generate a ssh key (for ssh access)
ssh-keygen -t rsa -C "your@mail.com"
In most cases you should accept the default path (.ssh/id_rsa). Just fill out all questions. Make sure you add a pass-phrase for security!
As a result you get two files: id_rsa -> your private key file and id_rsa.pub -> the public key. Never share your private key file with anyone.
Add the key to GitHub:
# Copy the public key to your clipboard
pbcopy < ~/.ssh/id_rsa.pub
Paste the public key to the SSH-Key section at github.com
Test the connection
ssh -T git@github.com
The GitHub SSH Server should recognize your account and close the connection.
Setup global config
git config --global user.name "Your name" && \
git config --global user.email "your@email.com"