問題描述:git
重裝過一次系統,在重裝以前git+tortoisegit配合很好,提交的時候都能自動加載ppk,可是重裝系統後,也從新生成pulic key上傳到了服務器,可是每次提交的時候都提示key加載失敗,必須手工的將key加載到pageant中才能夠正常提交
問題分析:
每一個git項目的config文件都保存了ppk的地址,重裝完系統從新生成key後,ppk的保存路徑和文件名都發生了變動,因此致使每次提交的時候,依據config都找不到ppk的地址,因此報錯!
解決辦法:
打開TortoiseGit->Settings,而後選擇git->Remote,選中origin,而後在Putty Key中指向本身新的ppk文件
參考網址:http://stackoverflow.com/questions/7068485/tortoisegit-and-pageant-have-to-add-key-every-time
All done very quick and easy if you know the right places:github
- Open up the "TortoiseGit > Settings" in your project folder
- Navigate to "Git > Remote"
- Select the correct origin
- "Putty Key" > "..." > navigate to your *.ppk file
- 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