Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

A successful git branching model 導讀

1,744 views

Published on

11/Jan/2015: 新增為什麼要用FF以及release圖片少說明的地方
12/Jan/2015: Fix typo

Published in: Software

A successful git branching model 導讀

  1. 1. Wen Liao A successful Git branching model 導讀 高雄,旗山
  2. 2. Disclaimer 投影片資料為作者整理資料及個人意見,沒有經 過嚴謹確認,請讀者自行斟酌
  3. 3. 目標 導讀 A successful Git branching model的軟體 Release方式 URL: http://nvie.com/posts/a-successful-git- branching-model/
  4. 4. 背景知識 Fast Forward Merge 簡稱FF
  5. 5. 背景知識 Fast Forward Merge in GIT: Before branch Master Branch Head Master Head
  6. 6. 背景知識 Fast Forward Merge GIT: After branch Master Branch Head Master Head
  7. 7. 背景知識 非Fast Forward Merge in GIT: Before branch Master Branch Head Master Head
  8. 8. 背景知識 非Fast Forward Merge GIT: After branch Master Branch Head Master Head merge
  9. 9. 為什麼要提FF? ● 可以保留branch更動的footprint
  10. 10. branch Master Branch Head Master Head branch Master Branch Head Master Head mergeVS 那一個比較清楚地顯 示軟體branch的關聯 性?
  11. 11. 作者的Branches 分類 ● Main branches ○ Master ○ Develop ● Supporting branches ○ Feature ○ Release ○ Hotfix
  12. 12. Main Branches Develop Master branch merge when production release merge when production release AKA: integration Master: 保證product ready 狀態 Develop: ● 隨時為下一次 Release準備 ● 放 ○ Feature ○ Fix ○ Release更動 ■ 版號 ■ 路徑 ■ ... Tag: 版號 Tag: 版號
  13. 13. Feature Branch ● 一定從develop branch出來 ● 寫完merge 回develop branch ● 寫的不如預期可以宰掉 ● 一定要用NO FF ● 可以定相關的branch name convention
  14. 14. Feature Branch: USE NO FF merge branch Develop Branch Head Develop Head merge
  15. 15. Release Branch ● 一定從develop branch出來 ● 用來處理Release相關事物 ○ 改版號 ○ 改PATH ○ ...
  16. 16. Release Branch ● Branch出來,處理Release相關事物中,如果 發現錯誤,要merge 回develop branch ● 確認無誤,可以出貨後 ○ merge回develop和master ○ master tag release版號 ○ 可以宰掉release branch ● 一定要用NO FF ● 可以定相關的branch name convention
  17. 17. Release Branch: USE NO FF merge branch Develop Release Head Develop Head Bug fix merge merge Master Master Head Tag with version
  18. 18. Hotfix Branch ● 一定從master branch出來 ● 用來處理Release後被客戶或是QA抓包的錯 誤 ● 可以順便進版表示該版本是Fix bug,如1.2晉 升到1.2.1 ● 修正完畢要merger回master,視情況merge回 develop ○ 因為有可能develop已無此功能或是已修正
  19. 19. Hotfix Branch ● 如果舊版正在進行hot fix,而新版release branch也正在進行中,請直接merge到release branch而不是develop branch ● 確認修正後,可以刪除該branch ● 一定要用NO FF ● 可以定相關的branch name convention
  20. 20. Hotfix Branch: USE NO FF merge branch Develop Hotfix Head Develop Head Bug fix merge merge Master Master Head 進版Bug fix

×