http://www.ithao123.cn/content-10889965.html 
 
新建文件:mkdir wakav  
进入文件:cd wakav  
初始化:git init  
配置用户名和邮箱: git config --global user.name "lining"  git config --global user.email "lining@orgtec.cn"创建新的KEY: ssh-keygen -t rsa -C "lining@orgtec.cn"  Creates a new ssh key using the provided email Generating public/private rsa key pair.  #此处输入将要保存的路径,默认为当前路径  Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<press enter>  输入回车后提示输入一个类似于密码的自定义的通行证号,如果直接回车则为空  Enter passphrase (empty for no passphrase):<enter a passphrase>  #提示重新输入以便确认输入是否正确  Enter same passphrase again:<enter passphrase again>  查看新的key: vi ~/.ssh/id_rsa.pub将内容添加到服务器上。 从远程服务器克隆项目代码到本地: [root@localhost wakav]# git clone ssh://lining@IP:8849/wakav正克隆到 'wakav'...Unable to negotiate with 114.215.120.180: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.vi ~/.ssh/config内容如下: Host somehost.example.org(这是服务器地址)    KexAlgorithms +diffie-hellman-group1-sha1然后就可以克隆成功了! Author:leedaning   
 |