- Create a script called: git_ssh_wrapper.sh
- Give the script executable permissions:
chmod 777 git_ssh_wrapper.sh - The contents of the script should look like the following:
#!/bin/bash
ssh -i /home/user/RSA_Keys/id_rsa $1 $2 - Export variable GIT_SSH:
export GIT_SSH=~/git_ssh_wrapper.sh - Clone the repository as usual:
git clone user@server.com/repository.git
Search This Blog
Friday, October 4, 2013
Git clone - use different keys for different repositories / user another private key
To clone git repository with a different private key than your /home/user/.ssh/id_rsa
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
If you like this post, please leave a comment :)