Git+SSH Cheatsheet

Edit on GitHub

Git

Repository

Commit

Branch

Merge and Rebase

Merge = create commit from two parallel tracks of changes; Rebase = Act like changes happened in sequence. Merging is usually faster and works in all situations, but rebase makes the commit history look nicer.

SSH

Public key authentication

The SSH-agent

If you are using public key authentication and don’t like typing passwords, add this at the end of your .bashrc / .zshrc / .profile (on the client):

eval "$(ssh-agent)"

Next, add into your ~/.ssh/config (create it if it does not exist):

AddKeysToAgent yes

If you wish to use the same key on the remote (for example, with git), also add this:

Host example.com
    User username
    ForwardAgent yes