Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git Flow and Coding Style

Bo-Yi Wu
January 24, 2016

Git Flow and Coding Style

Bo-Yi Wu

January 24, 2016
Tweet

More Decks by Bo-Yi Wu

Other Decks in Technology

Transcript

  1. Git merge •  Create your branch – $ git checkout –b

    ‘response’ •  Merge from develop branch – $ git merge develop
  2. Git rebase •  Create your branch – $ git checkout –b

    ‘response’ •  Merge from master branch – $ git rebase develop
  3. Rebase vs Merge 優缺點 rebase   merge   避免過多  merge

     commit  log   產生  merge  commit  log   Branch  commit  log 排到最前面(方便追 蹤)   依照時間排序  commit  log   network graph 清楚   network graph 不易理解   各別  commit 解決 conflict   一次將全部衝突顯示   可任意修改  commit  log   可合併多個  commit  (避免過多無意義   commit  log)  
  4. Rebase vs Merge 使用時機 rebase   merge   整理  Branch

     commit  log   主分支記錄合併 xxxx  branch   非主分支開發無需記錄何時合併主分支   主分支請勿使用  rebase 合併任何分支  
  5. Yoda Conditions https://en.wikipedia.org/wiki/Yoda_conditions if ($a === ‘1’) { // code

    block } if (‘1’ === $a) { // code block } 程式閱讀性高   程式閱讀性低