21

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! :-)

Rick Hodgin
  • 657
  • 2
  • 8
  • 15
  • If you load pageant with your key before you do anything with Tortoise SVN, does it ask you for anything? – Mat Aug 15 '11 at 17:47
  • It's Tortoise Git, not SVN, but yes if I pre-load manually by supplying "c:\path\to\private.ppk" on the command line, then it works. – Rick Hodgin Aug 15 '11 at 17:48
  • 1
    The just pre-load pageant (with a .cmd in your start profile). – Mat Aug 15 '11 at 17:49
  • There's no way to have TortoiseGit handle this automatically? It is launching pageant on its own, surely passing a parameter would not be undoable. Maybe I have a new project to contribute to (to add this feature). :-) Thanks, Mat! – Rick Hodgin Aug 15 '11 at 18:10
  • Did you realize when you committed, the "Git Command Progress" window that tells you it worked has a button at the bottom left which says "Push"? This doesn't solve your original problem, but it speeds up your step 4) ;-). – Jonas Heidelberg Aug 29 '11 at 16:48
  • @Jonas, I found that feature a few days ago, but was unaware of it at the time. Definitely speeds things up. Still believe Git is a version or two away from being close to user friendly. :-) – Rick Hodgin Aug 31 '11 at 18:30
  • Do you see a problem with Git? Or TortoiseGit? I agree the latter is still a bit rough, but a step in the right direction ;-). – Jonas Heidelberg Aug 31 '11 at 18:35

3 Answers3

24

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"

Simon East
  • 55,742
  • 17
  • 139
  • 133
22

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 = git@github.com:some_one/some_project.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    puttykeyfile = C:\\Users\\some_one\\.ssh\\some_one@some.com\\id_rsa.ppk
ufo
  • 1,622
  • 16
  • 15
  • 1
    This worked for me and seems like the way the TortoiseGit developers intended this to be accomplished. – rajb245 May 06 '16 at 21:49
0

As @Simon East stated it is the right way to load the proper link into the startup folder.

The other way around this problem for people who use multiple keys, tortoisegit, putty, pageant in both console prompt and in explorer with Tortoisegit would be to start pageant when it is needed (when interacting with remote repository). And use the proper key for each remote repository.

I have wrote the wrapper for Tortoisegit's ssh client which checks the pageant and loads keys depending on what repository it interacts with. At the moment it checks only for github repos and links them keys. but the other bitbuket or gitlabs functionality could be added to the source code.

It was created just for personal convenience, so do not beat me hard :)

Mark Booth
  • 7,605
  • 2
  • 68
  • 92
zds
  • 914
  • 1
  • 10
  • 22