提示:进入项目文件操作
步骤:
1.git init ----------初始化git仓库
2.git remote add origin 你的项目地址 ------------------如:https://gitee.com/lh_resource /*** (链接新建仓库)
报错:fatal: remote origin already exists 使用:git remote rm origin
3.git add . -------------项目中所有文件保存到缓存
4.git commit -m '对上传文件的注释' -------- 提交代码
5.git push -------- 提交到仓库
如提交有问题:
git push origin master -f 表示舍弃线上的文件,强制推送
分支切换
1.git branch -a ------------查看所有分支
2. git branch -----------查看当前分支
3.git checkout -b 分支名称 分支路径 --------------切换当前分支