提示:進入項目文件操作
步驟:
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 分支名稱 分支路徑 --------------切換當前分支