Version Control


I use SSH URLs to access my GitHub repositories. This requires that you add your public SSH key to your GitHub profile. Your SSH keypair can be found in the .ssh directory in your home directory on your Mac. It consists of two parts, a private key and a public key.

If you do not have a SSH keypair yet, you can generate one with the following command:
ssh-keygen -t rsa -b 4096 -C ""
If you have copied your SSH keypair from another machine, it is very important to ensure the correct permissions on the .ssh directory and on your SSH key files:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/

Git Identity

To set your git identity for every repository on your computer:
git config --global "John Doe"
git config --global ""
To set your git identity for a single repository on your computer, enter the following commands from inside said repository:
git config "John Doe"
git config ""
You can confirm with:
git config

Multiple Identities

You can use the SSH config file to manage multiple SSH keypair identities. For example, if you use one SSH keypair for GitHub and another SSH keypair for your hosting service or if you use more than one GitHub account.
  User git
  IdentityFile ~/.ssh/id_rsa_john1
  IdentitiesOnly yes
You can now clone a repository using the host setup in the above SSH config:
git clone
Note: instead of