新版的Windows10系统自带openssh客户支持,可以很好的支持git及需要用到ssh本文将登录应用程序git每个人都常用安装和安装github详细说明代码克隆问题。
软件需要准备git for windows Git-2.37.3-64-bit.exe
TortoiseGit TortoiseGit-2.13.0.1-64bit.msi
TortoiseGit中文语言包 TortoiseGit-LanguagePack-2.13.0.0-64bit-zh_CN.msi
软件安装所需的软件首先安装git for windows,可按推荐设置,无需更改。
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016100-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016220-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016290-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016350-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016360-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016380-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016390-L.jpg)
接下来安装TortoiseGit
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016400-L.jpg)
下一步要特别注意,配置不能默认,默认使用不能使用新版本Windows自带的openssh客户端生成公私钥来访GitHub了。
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016420-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016430-L.jpg)
点击下一步
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016440-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016470-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016480-L.jpg)
安装中文语言包
![](https://img.pc-daily.com/uploads/allimg/221102/9-2211022016490-L.jpg)
首次运行配置,按默认情况
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201A10-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201A30-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201A50-L.jpg)
使用下面截图中的命令创建windows10访问私钥,然后填充相应的github账户即可。
ssh-keygen
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201A80-L.jpg)
以下图片可以导入访问公钥github,这样访问github非常稳定,和https访问方式的效果完全相同,克隆的命令有以下变化
将:
git clone https://github.com/obsproject/obs-studio.git
改成:
git clone git@github.com:obsproject/obs-studio.git
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201F00-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201F10-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201F30-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201F40-L.jpg)
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201F50-L.jpg)
添加后,可以使用上述命令克隆github仓库,成功访问公钥时github后,github后台刚加条目的钥匙会变绿。
![](https://img.pc-daily.com/uploads/allimg/221102/9-221102201F60-L.jpg)