Custom ssh key for git command

Assume the private key location is in /home/transang/custom-key.pem. Use this command to specify the key.

GIT_SSH_COMMAND='ssh -i /home/transang/custom-key.pem' git@github.com:transang/my-repo.git

source