1、安装git
2、打开git Bash,产生密钥
- 在git bash命令行窗口敲入cd ~/.ssh
- 生成公钥和私钥
$ ssh-keygen -t rsa -C "[email protected]" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/zhaolei.MEIJINSZ.000/.ssh/id_rsa): id_rsa_sz 如果你.ssh目录下已经有公钥和私钥了,在这一步可以重新命名一个新的密钥名字,如id_rsa_sz Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in id_rsa_sz. Your public key has been saved in id_rsa_sz.pub. The key fingerprint is: e1:f3:93:32:8f:bc:5e:57:c2:7b:31:19:39:51:aa:cd [email protected]
- ok,你可以看到在你的.ssh目录下新生成了两个文件id_rsa_sz和id_rsa_sz.pub
- 将id_rsa_sz.pub发给git管理员,管理员将你的公钥信息加入到服务器上。
3、配置tortoiseGIT
- 打开tortoiseGIT下的PuTTY Key Generator
- 点击load,选择刚刚我们生成的私钥文件id_rsa_sz
- 点击Save private key,保存到.ssh下面,假设为git_sz.ppk
- 进入你的WORKSPACE,右键GIT CLONE。
URL:[email protected]:/www/gitdata/qa-core.git
Dir:WORKSPACE\qa-core
勾选Load Putty Key,选择上面生成的ppk文件git_sz.ppk。
点击ok,代码就被clone到本地了。