step1 建立本地 git
仓库
//启动终端,cd至项目目录,执行git仓库初始化
git init
step2 将文件提交至本地仓库
git add .
git commit -m "注释"
step3 gitee
创建仓库
登陆账号新建仓库,并复制地址,例如 https://gitee.com/rymcu-community/nebula-pi-stm32.git
step4 本地仓库关联 gitee
git remote add origin https://gitee.com/rymcu-community/nebula-pi-stm32.gi
step5 将本地仓库上传至 gitee
仓库
git push -u origin master
注意:
上传前提示需输入账号、密码。账号为 gitee
用户名不带 @
及其后缀,密码为账号登陆密码。如果上传报错,则先将 gitee
仓库内容全部删除干净,执行下面代码:
git pull --rebase origin master
成功后,在执行 step5
上传。
step6 代码更新
后续有代码更新,执行下面代码即可推送至 gitee
远程仓库。
git add .
git commit -m "注释"
git push -u origin master
?