Git: choose your ssh key
create a GITSSH wrapper in your ~/bin/gitsshwrapperdeploy
#!/bin/bash
ssh -i /home/charlybr/.ssh/deploy_id_rsa $1 $2
export this wrapper when logging in
In your .bashrc for example:
export GITSSH="/home/charlybr/bin/gitsshwrapperdeploy"
or you can just export this env variable when you need it
git clone && code monkey
You're done!
Written by CharlyBr
Related protips
2 Responses
Or just use ssh-agent(1) and avoid all this juggling?
over 1 year ago
·
But does it work with automated shell scripts that use git ?
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ssh
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#