本地项目如何关联远程仓库
2022-03-25 本文已影响0人
清风昙
如何将本地开发的项目代码关联推送到远程仓库(Github或Gitee),操作如下:
1.先在Github或Gitee创建个仓库,存放项目代码

2.本地项目使用Git Bash打开或者在编辑器终端(控制台)

3.设置全局用户名和邮箱,如果已经全局设置过可略过,主要用于在Gitee上显示提交人。git config --global user.name "xxx"和git config --global user.email "xxx@qq.com"

4.初始化git本地仓库 git init
5.将本地项目添加到git进行托管。git add .
6.将本地仓库与远程仓库关联。git remote add origin https://gitee.com/petons/uniapp-demo.git

7.提交和推送
git commit -m '注释'
git push origin 分支名