本地项目上传到git上
在本地建立项目后
1,创建仓库,git初始化,命令:git init
2,吧项目上传添加到工作区,git add .
3,提交, git commit -m “注释”
4,链接远程git仓库, git remote add origin https://gitee.com/xxxx/xxxxx.git
5,创建SSH key,ssh-keygen -t rsa -C “xxxxx@xxxxx.com”
三次回车之后会生成公钥文件和私钥
6,cat cat ~/.ssh/id_rsa.pub
7,登陆账号设置,公钥标题随便写,下面吧生成的文字复制到里面保存
8,git push -u origin master上传到项目
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021040700091176.png)
9,如果出现上面则在进行git remote add origin https://gitee.com/xxxx/xxxxx.git
10,在git push -u origin master 上传
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210407001104538.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1RoZV9H,size_16,color_FFFFFF,t_70)
上传成功