[Git] Git 自學筆記 : git rebase stash 使用時機

  • 794
  • 0
  • Git
  • 2016-11-30

多人開發時
準備要merge時 git rebase & stash 使用時機

本文主要git指令:git fetch
                          git stash
                          git rebase 
                          git rebase --continue
       

當多人同時修改同一專案時
準備要commit 之前
1.git fetch 
   確認server是否有最新版本

2.git stash (暫存目前修改作業)
   當你要rebase系統會要求你commit 或stash    

$>Saved working directory and index state WIP on master: 19b4517 stash a1:
HEAD is now at 19b4517 stash a1:

git stash #當你作業到一半 不想commit ,可先暫存
git stash list #顯示暫存清單
git stash pop #取出暫存,繼續作業
git stash drop #刪除目前暫存
git stash clear #刪除所有暫存

3.git rebase
   發生衝突時,需先解衝突,同merge的解衝突
   解完衝突 再繼續 以下步驟4
4.git rebase --continue


參考:老弟StanelyFang的使用經驗