Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 724
Rick Hodgin Avatar asked Aug 15 '11 17:08

Rick Hodgin


People also ask

Where are TortoiseGit settings stored?

By default, TortoiseGit uses the Windows home directory which is normally located under c:\Users and MSYS2 uses its own home directories which are located under [MSYS2-INSTALL-PATH]\home .

How do I use TortoiseGit?

Right-Click in the File explorer within the repository and select TortoiseGit =>Create Branch. Name it enhancement and select the checkbox Switch to the new branch. Click Ok. Make a change to the file in the enhancement branch and commit the same.

How do I open TortoiseGit?

You can open it using TortoiseGit → Repo-browser or from the log dialog (cf. the section called “Log Dialog”) using the context menu of a commit.

What is Git EXE path TortoiseGit?

14.0 of TortoiseGit, which is the latest. The TortoiseGit Git.exe Path setting currently points to C:\Program Files\Git\cmd .


2 Answers

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"

like image 139
Simon East Avatar answered Oct 19 '22 23:10

Simon East


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
like image 28
ufo Avatar answered Oct 20 '22 01:10

ufo