问题描述: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