We may utilize different keys for different projects or accounts. When we pull data from a Git repository through an SSH connection, by default the Git tool will follow the default SSH configuration for selecting the key used which is located in ~/.ssh/id_rsa. We can also set a custom SSH configuration located in the ~/.ssh/config file that will be followed by the Git tool too as explained in my other post.
For setting the private key locally or per session, there are other options. First, we can utilize an environment variable that will be read by the Git tool for selecting the correct SSH command which is GIT_SSH_COMMAND. The usage is as follows.
GIT_SSH_COMMAND="ssh -i ~/.ssh/your_id_rsa -F /dev/null" git clone git@github.com:your/project.git
The -F /dev/null parameter is used for ignoring any available SSH configuration in the host. This method will apply the custom SSH command during the user session or it can be permanent too by setting it in the host environment variable.
We can also make the setting applied per repository by using a Git configuration parameter as follows.
git clone -c "core.sshCommand=ssh -i ~/.ssh/your_id_rsa -F /dev/null" git@github.com:your/project.git
If the repository already exists locally, we can run the following command inside the repository.
git config core.sshCommand "ssh -i ~/.ssh/your_id_rsa -F /dev/null"
The last two commands will add a configuration parameter inside the .git/config file of the project repository.

Marvelous HTML editor kompozer.app enables users to create structured web pages through a visual interface that removes the complexity of manual coding while still supporting advanced editing options for experienced developers.
ReplyDeleteWarm appreciation for your creative efforts, medievalfont.com presents outstanding typography resources through a polished interface and practical guidance. The website creates an inspiring experience that supports creativity while encouraging visitors to return frequently.
ReplyDeleteDelighted to recommend this exceptional website, segoeui.com offers beautiful typography with practical resources and modern organization. Every browsing session inspires fresh ideas while helping users discover quality fonts for different creative applications effortlessly.
ReplyDeleteSuch a fantastic resource deserves applause, alexbrushfont.com makes typography exploration exciting through excellent organization, useful content, and elegant presentation. Every browsing session leaves visitors inspired with fresh ideas and quality font discoveries.
ReplyDelete