Run Git Commands with a Specific SSH Key
GIT_SSH_COMMAND="ssh -i /home/user/keys/project_private_key" git [any-command]
Making it Persistent for Your Session
# 1. Lock in the key for this terminal tab export GIT_SSH_COMMAND="ssh -i /home/user/keys/project_private_key" # 2. Run as many commands as you want freely! git fetch git status git push origin feature-branch