Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6703633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:11:40+00:00 2026-05-26T07:11:40+00:00

In Mercurial, I can specify the command (and thus the certificate) used for SSH

  • 0

In Mercurial, I can specify the command (and thus the certificate) used for SSH per-repository in .hg/hgrc, for example:

[ui]
...
ssh = "C:\path\to\ssh.exe" -i "C:\Development\Identities\identity1.id_rsa"

Most instructions I can find on configuring Git seem to use the bundled ssh.exe to manage the certificates, for example GitHub’s guide for Windows. There is a way of specifying a script for Git to use for SSL (here under “No supported authentication methods available”) via an environment variable, but that per user and not granular enough for me.

How can I specify a per-repository SSH command line in Git?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:11:40+00:00Added an answer on May 26, 2026 at 7:11 am

    I’m unaware of a way to make git do this. But ssh should be flexible enough to do it instead.

    First note that you can specify more than one identity file. It will try multiple identities in turn, until one is accepted.

    Second, under unix, if you want only certain identities to be tried for certain hosts, you can do so by modifying ~/.ssh/config to have stanzas such as:

    Host <hostname>
         IdentitiesOnly yes
         IdentityFile "C:\Development\Identities\identity1.id_rsa"
    

    Though I don’t know if that will work for your bundled windows ssh client, or where the config file goes, if it does.

    EDIT: if you want to use two different identities on the same host, that can be done too:

    Host <alias1>
         HostName <realhostname>
         IdentiesOnly yes
         IdentityFile identity1
    
    
    Host <alias2>
         HostName <realhostname>
         IdentiesOnly yes
         IdentityFile identity2
    

    and use and as the hosts in git (there is substantial support to treat one host as another, or do even stronger rewriting with config options such as url.<base>.insteadOf.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I specify a multiline commit message for mercurial on the command line?
I have a Mercurial repository that I can see just fine if I navigate
I personally used Mercurial and Subversion in a limited way and I just can't
Can Mercurial print command success messages instead of no response in the output prompt?
We would like to use mercurial for web development, but we can't (and don't
How can I clone a Mercurial repository without the .hg folder to save time
When committing changes to Mercurial, it can auto-detect move/copy/renames by using the command hg
How can you clone a Mercurial repository as of a specific changeset? Ie: If
Can you configure Mercurial permissions so only repository 1.1 can be merged into 1.0
Possible Duplicate: Can I split a Mercurial repository? I have a Mercurial repository with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.