If you keep more than one GitHub (or GitLab, or whatever) identity, you usually end up with more than one private key. The usual fixes are Host aliases in ~/.ssh/config, or typing GIT_SSH_COMMAND='ssh -i ~/.ssh/some_key -o IdentitiesOnly=yes' git … before every command. Both work. Neither is what I want when I just opened a random repo in a deep path and want my fingers to do the right thing.
Reminder: you can pin the SSH command on a single clone:
git config core.sshCommand "ssh -i ~/.ssh/your_private_key -F /dev/null"
That lands in .git/config for that repository only. Every git fetch, git pull, git push from that directory uses that key. No wrapper script, no repeated env var.
-F /dev/null tells ssh not to read your normal config file for that invocation. That matters when your global config would otherwise offer several keys and confuse github.com about which one you meant. Pair with -o IdentitiesOnly=yes if your agent still tries to hand out the wrong identity first.
This does not travel with the remote (.git/config stays local), so a fresh clone needs the line again, or you automate it once in a bootstrap script. For “this laptop folder always means my work GitHub,” that tradeoff is usually fine.