How to specify custom ssh key while git clone from github

If you need to provide some custom ssh key while cloning your repository from github (or pulling, whatsoever), run this command:

ssh-agent $(eval `ssh-agent -s`; ssh-add ~/.ssh/{your-custom-keyfile}; git clone{username}/{repo-name}.git .)

Please note, you should replace `{strings}` with plain string values!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.