1 顶部菜单栏 设置
文章图片
2 设置中上传ssh公钥
文章图片
3 获取公钥 终端输入以下代码 email@yeah.net为自己的邮箱
$ ssh-keygen -t rsa -C "email@yeah.net"
4 打开保存公钥的文件夹
$ cd ~/.ssh
$ cat cat id_rsa.pub
文章图片
得到的以ssh-rsa开头的就是公钥啦~添加的时候不要尾部的邮箱
5 在码云里创建一个仓库 仓库名称最好和自己项目名字一样
文章图片
6 然后在终端cd到自己项目的目录下 再对项目初始化
$ git init
文章图片
7 把项目和自己的码云进行映射 name填自己码云的名字 Program是项目名字
$ git remote add origin git@gitee.com:name/Program.git
8 三句话不解释【这三句每次更新了代码都要写一遍】
$ git add *
$ git commit -m “suki570info”
$ git push
第三句话如果出了如下提示就按照提示写
suki570-MacBook-Pro:Program suki570$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, usegit push --set-upstream origin master
$ git push --set-upstream origin master
9 大功告成
文章图片
10 参考
1 使用码云
2 Mac生成公钥
【Mac|Mac下码云简单使用】3 某大佬