Today I Learned

A Hashrocket project

Use another SSH key/command for Git

If you need to use a different SSH key for a git command such as git put you can do so by setting the GIT_SSH_COMMAND environment variable like so:

GIT_SSH_COMMAND="ssh -i ~/.ssh/custom_key" git put -u

This can become a lot easier to use if you define that env var automatically when entering a directory by using direnv.

h/t Thomas Allen