Search code examples
windowsmercurialtortoisehg

How to make Mercurial on Windows use an SSH key for push/pull?


How to tell TortoiseHg (or Mercurial in general) that I want to use a given SSH key when pushing/pulling to/from a remote repository?


Solution

  • On Windows, see Accessing SSH-controlled repositories from a Windows client: you need PuTTY, plink and a particular config setting.

    To put that in a particular repository, put in .hg/hgrc

    [ui]
    ssh="C:\path to\plink.exe" -ssh -i "C:\your path to\private.key"
    

    Also note that you don't need to specify the key path if you use pageant.