Archive for the ‘git’ Category

Setup SSH keys on Mac

Tuesday, July 26th, 2016

Generate SSH keys, defaults at ~/.ssh/id_rsa and id_rsa.pub

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Run Mac’s ssh-add command (not ssh-agent), adds default keys if no key is specifed, -K adds passphrases to keychain.

ssh-add -K

Create a text file called ~/.ssh/config with this content:

Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_rsa

Git diff branch only

Tuesday, May 17th, 2016

To see only the differences between master and branch from when they diverged (pull request style) do

git diff master...branch #note: three dots

To see all differences between master and branch do

git diff master..branch #note: two dots

Note that master or branch can be replaced with any ref like head depending on which branch you have checked out.