git 的ssh应用

1.首先在要拉取代码的机器或服务器上生成ssh公钥

        1.1使用命令: ssh-keygen -t rsa -C  “[email protected]” 生成

        1.2之后找到生成后的秘钥存放位置打开id_rsa.pub 文件将里面的公钥复制出来

2.将上一步复制的公钥添加到你的代码管理平台上

3.直接使用git clone + ssh地址就可以了

4.如果原来使用hhtp拉取的代码可以通过一下命令修改

        git remote set-url origin [email protected]:someaccount/someproject.git

你可能感兴趣的:(git,git,ssh,服务器)