【Git】使用 Conventional Commits 規範優化 commit message

【Git】使用 Conventional Commits 規範優化 commit message

本篇重點

  • Conventional Commits 是建立在 Git Commit Message 上的輕量規範,讓 Commit 同時具有人類與機器可讀的結構
  • 基本格式為 <type>[optional scope]: <description>bodyfooter 皆為選填
  • 彙整主要 commit type 類型及其適用情境
  • Conventional Commits 能讓 Commit History 更容易閱讀,還能提供 Changelog、Semantic Versioning、Release 與 CI/CD 自動化所需的結構化資訊

【Git】使用 git rebase 整理提交歷史

【Git】使用 git rebase 整理提交歷史

本篇重點

  • 如果有尚未提交的變更,無法使用 git rebase
  • git rebase 合併不會產生額外的合併提交,但是會變更原本的提交 ID
  • git rebase -i(互動式 rebase)編輯功能
  • 使用 git rebase -i 調整提交順序、修改提交訊息、修改提交內容、合併提交、刪除提交
  • git rebase 的注意事項

複製完成