便携版的git是即插即用的,可以在任意一台没有安装git的电脑上使用。如果采用和桌面版git相同的方法设置ssh私钥,是无法正常使用ssh访问github远程仓库的,即使我将私钥保存在U盘上。下面是错误信息:
The authenticity of host 'github.com (192.30.253.112)' can't be
established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of know
n hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
我想知道如何在便携版的git如何设置ssh私钥才能保证我正常连接远程仓库。
黄舟2017-05-02 09:45:52
I found the configuration method based on the readme file in the git mobile version. In fact, the method is very simple. The configuration steps are basically the same as the method of configuring ssh-key in the desktop version of git, except that the step of selecting the storage path of the key is different - do not press Enter to use the default path, but change the path to a USB flash drive. The path to the git version (such as g:\git_portable\.ssh). Then, every time you use git (mobile version), first use the export HOME=g:\git_portable
临时修改HOME
environment variable, and the subsequent installation path of the mobile version of git should be set according to your actual situation.
This way you can use ssh to access your github remote repository just like in the desktop version of git.
Note, don’t ignore the double slash \ in the above path.