For Linux and Windows WSL users (may work on Mac but untested)
Download this ssh agent key caching script I created to your ~/.ssh/
folder
Link to it in your ~/.bashrc
by adding these lines to the end of the file
# Load the SSH key agent management script
if [ -f "$HOME/.ssh/key_agent.sh" ]; then
. "$HOME/.ssh/key_agent.sh"
fi
Finally in your terminal, set git to always use the ssh-agent by running the following
git config --global core.sshCommand "ssh -o IdentityAgent=$SSH_AUTH_SOCK"
The key agent script will check whether keys are already loaded and if so apply them to the current terminal or if not load any of the keys that have not been loaded and apply them.