--- tags: castles, cs, git, rule, principle lang: zh-tw --- # Git principles for teams #### :label:1.3.0 :alarm_clock: 2021.09.24 ## Branch 管理 1. 兩條長久線:master、develop 2. 其餘分支必須以 "hotfix-", "feature-", "release-" 其中之一做為開頭 > 分支用途說明: > * hotfix > 僅適用於修復嚴重 bug,直接從 master 分支出來時使用,其餘非 master 的 bug 使用 feature > * feature > 從 develop 分支出進行的任何修改 > * release > 從 develop 分支出去準備出正式版本前,整合測試使用。測試期間遇到 bug 可直接修改並 commit 在 release 上。 > 測試完成才可 merge 回 master,並加上 tag 定版。測試期間曾經修復 bug 也要 merge 回 develop 3. merge 回 master 或 develop 時,一律加上 "--no-ff",以清楚表示"合併分支" 4. 不能直接 commit 在 develop 及 master 分支 5. 不要把 develop 合併至 master, feature 及 release 分支 6. 需要客制化時,直接從網頁上 Fork 一個 Respository,拉取後進行開發調整。 ```bash= git clone https://git-scm.example.cloud/org/repo_custom ``` ## Message 撰寫風格 1. 標題不可超過 50 個英文字元 (限用英文) 1-1. 標題內容為 [ 案號 ] 說明 1-2. 標題結尾不需要結尾符號 2. 說明事件原因與修改內容 3. 標題與內容以一列空行做分隔 #### Example ```bash= [XXX-239] Use member function, toArray() The code to convert the class, PrmUiFile, is copied into the class before. The code works fine, so replace the original code into the member function. Furthermore, use echo_pack() to return the status and the data in one line. - Replaced by PrmUiFile::toArray() - Replaced by echo_pack() ```