1.基礎(chǔ)操作
git status -s查看有什么改動(dòng)
git checkout -b feature/resource_form新建個(gè)分支
git branch查看分支
git add .添加文件到緩存區(qū)
git commit -m ’feat: ‘提交并寫(xiě)注釋
git remote 查看提交名字origin
git push (origin) (feature/resource_form)
remote 分支名
選擇合并的分支,進(jìn)行申請(qǐng)
刪除本地分支:git branch -d dev20181018
2.合并解決沖突
git checkout test切換test分支
git checkout -b feature/test 新建切換一個(gè)分支
git pull origin test 拉下test里的代碼
git merge feature/test/channel 合并feature/test和 feature/test/channel里的代碼,解決沖突
git add . 提交文件
git commit -m "Merge branch 'feature/test/channel' into feature/test”提交文件
git push origin feature/test
3.撤銷(xiāo)操作
git reflog查看提交的歷史記錄
git reset —hard HEAD@{n}回退版本
4.更新本地代碼
git remote -v: 查看遠(yuǎn)程倉(cāng)庫(kù)詳細(xì)信息,可以看到倉(cāng)庫(kù)名稱(chēng)
git checkout —track origin/branch_name 本地新建分支追蹤遠(yuǎn)程分支(目前沒(méi)發(fā)現(xiàn)作用)
git branch -a 查看所有的遠(yuǎn)程分支標(biāo)紅
git remote update origin 更新本地分支
git checkout origin/feature-dev -b feature/dev 本地新建分支追蹤遠(yuǎn)程分支