I'm trying to automate logins to GitHub using a private key, so that I can do "git pull/add/commit/push" from a BASH script. If I put this in ~/.ssh/config, it works:
Hostname github.com
User git
IdentityFile ~/.ssh/mygitkey.pem
Unfortunately, this causes all SSH connections to be routed to Github.com, which I don't want.
So I tried this:
Host GitHub
Hostname github.com
User git
IdentityFile ~/.ssh/mygitkey.pem
But this causes the "user" and "identityFile" options to be ignored when connecting to GitHub.