TortoiseGit and Pageant, have to "add key" every time

14,344

Solution 1

I just place a shortcut to pageant.exe with my PPK in my Start Menu "Startup" folder, so that it loads automatically when Windows boots (although it asks for the password then too).

"C:\Program Files\TortoiseGit\bin\pageant.exe" "D:\Dev\Git Private Key.ppk"

Solution 2

All done very quick and easy if you know the right places:

  1. Open up the "TortoiseGit > Settings" in your project folder
  2. Navigate to "Git > Remote"
  3. Select the correct origin
  4. "Putty Key" > "..." > navigate to your *.ppk file
  5. Voilá!

Or simply manually add a "puttykeyfile" entry in the regarding "some_project\.git\config" file:

[remote "origin"]
    url = [email protected]:some_one/some_project.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    puttykeyfile = C:\\Users\\some_one\\.ssh\\[email protected]\\id_rsa.ppk
Share:
14,344
Rick Hodgin
Author by

Rick Hodgin

Software developer, journalist, welder.

Updated on June 06, 2022

Comments

  • Rick Hodgin
    Rick Hodgin almost 2 years

    Background: I'm using git and TortoiseGit with github.com. My development cycle on the .git local branch goes like this:

    1) Make whatever changes
    2) Right-click on directory, choose "Git Commit -> branch"
    3) Input the message and commit
    4) Right-click on same directory, choose "Git Push"
    5) I choose my options and...
    

    The first time each time I do this each day, Pageant auto-loads in the background and its icon appears in the system tray. But, it is not remembering the private.ppk I had previously loaded the day (or reboot) before.

    Each time I have to:

    Right-click -> "Add key" -> and then redo 4) and 5) above
    

    and then it works. I have created a manual icon/shortcut I can click which auto-loads:

    "C:\Program Files\TortoiseGit\bin\pageant.exe" c:\path\to\private.ppk
    

    And if I launch with that shortcut, it loads the key into memory and works fine.


    Question: How can I get TortoiseGit to remember or pass that "c:\path\to\private.ppk" parameter to pageant so when it auto-loads that first time it also auto-loads my private key?

    Is there a persistent setting I can use?

    Thanks in advance! :-)

  • rajb245
    rajb245 almost 8 years
    This worked for me and seems like the way the TortoiseGit developers intended this to be accomplished.