git config --global user.name "your name"
git config --global user.email "[email protected]"
git config --global color.ui true
ssh-keygen -t rsa -C "[email protected]"
- name it something like githubssh (generic, I know)
cat ~/.ssh/githubssh.pub
- Copy that output and go to SSH and GPG keys
- New SSH key, then paste the output of the previous command. Give it a name, add it.
ssh -i ~/.ssh/githubssh -T [email protected]
- Output should say "Hi github_username! You've successfully authenticated, but GitHub does not provide shell access."
- If not, remove the
id_rsa.pub
file and redo the steps. Take care if you have other ssh keys, do not delete them all.
gpg --full-generate-key
- Select RSA and RSA (default), and key length as 4096.
- Enter the asked details, and a password when prompted. When finished,
gpg --list-secret-keys --keyid-format LONG
- Output should be something like:
$ gpg --list-secret-keys --keyid-format LONG
#### /Users/hubot/.gnupg/secring.gpg
------------------------------------
sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid Hubot
ssb 4096R/42B317FD4BA89E7A 2016-03-10
gpg --armor --export <string after upper 4096R, here 3AA5C34371567BD2>
- Copy that entire output and go to SSH and GPG keys
- New GPG key, paste the previous output in the box, then press Add GPG key
git config --global user.signingkey <string after upper 4096R, here 3AA5C34371567BD2>
- To push verified commits from now on, make sure you put in the
-S
modifier, ie,git commit -S -m "Commit Message