本地仓库关联远程仓库,从远程仓库克隆代码

1.查看仓库的所有配置信息 

  git config -l  或者 git config --lis  

    如果没有则配置添加git的用户名 email信息

git config –global user.name “tylerdeng”
git config –global user.email “tdeng@fff.com”

2.生成秘钥

需要你配置的邮箱信息

$ ssh-keygen -t rsa -C “haiyan.xu.vip@gmail.com”  关联싨仓库配置的邮箱号

$ cat ~/.ssh/id_rsa.pub   显示出秘钥

3.在远程仓库添加生成的秘钥

注意拷贝时,key中的空格如有则删除

关联成功:则可使用命令把远程仓库代码克隆到本地仓库啦

  git clone git@gitlab.feihu.com:duo2.0/servers.git

�在远程仓库中�在的奋斗地方

原文地址:https://www.cnblogs.com/jiechn/p/3982702.html