git 多人克隆版本库文件,实现多人修改上传
1、创建ssh key --执行完成后会发现路径下会出现两个文件 id_rsa是私钥,id_rsa.pub是公钥,公钥可以告诉其他人
ssh-keygen -t rsa -C "此处填写邮箱账号"
2、登录gitlab或者github,打开 “Account settings”,“ssh key”页面:点击“add ssh
key” 在key文本框里粘贴 id_rsa.pub文件的内容, 然后在gitlab或者github中创建一个repo,
3、连接远程仓库
git remote add origin git@github.com:michaelliao/learngit.git //@后填写自己在gitlab或者github上创建的repo地址,
4、把本地库推送到远程库
$ git push -u origin master Counting objects: 20, done. Delta compression using up to 4 threads. Compressing objects: 100% (15/15), done. Writing objects: 100% (20/20), 1.64 KiB | 560.00 KiB/s, done. Total 20 (delta 5), reused 0 (delta 0) remote: Resolving deltas: 100% (5/5), done. To github.com:michaelliao/learngit.git * [new branch] master -> master Branch 'master' set up to track remote branch 'master' from 'origin'.
这样就可以连接到本地了,别的小伙伴可以将它克隆下来,拉到自己的电脑进行修改上传更新操作