There is another possibility. That’s to set core.sshCommand, e.g.
git config --local core.sshCommand "/usr/bin/ssh -i /home/me/.ssh/id_rsa_foo"
There’s one particular scenario when this strategy is particularly useful: that’s when you have multiple accounts on Github, as all accounts ssh to Github as git@github.com and it uses the ssh key to determine which Github user you are. In this case neither .ssh/config nor ssh-agent will do what you want.
Update — You cannot run the above until you have a local repository, so if you’re trying to clone a remote repository, you’ll need to specify the key manually as per drewbie18’s answer:
git clone -c core.sshCommand="/usr/bin/ssh -i /home/me/.ssh/id_rsa_foo" git@github.com:me/repo.git
Once you’ve cloned the repository you can use the git config command to set this permanently.