Skip to content

Git Commit Message Convention

seonpilKim edited this page Mar 25, 2022 · 1 revision

Commit Message Convention

Message Structure

๊ธฐ๋ณธ์ ์œผ๋กœ Commit Message๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์ œ๋ชฉ/๋ณธ๋ฌธ/๊ผฌ๋ฆฌ๋ง๋กœ ๊ตฌ์„ฑํ•œ๋‹ค.

type : subject

body

footer

The Type

  • Feat: ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€/๋ณ€๊ฒฝ/์‚ญ์ œ
  • Fix: ๋ฒ„๊ทธ ์ˆ˜์ •
  • Docs: ๋ฌธ์„œ ์ˆ˜์ •
  • Style: ์ฝ”๋“œ ํ˜•์‹(format), ์„ธ๋ฏธ์ฝœ๋ก  ๋ˆ„๋ฝ ๋“ฑ (์ฝ”๋“œ ๋ณ€๊ฒฝ์ด ์—†๋Š” ๊ฒฝ์šฐ)
  • Refactor: ํ”„๋กœ๋•์…˜ ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง
  • Test: ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€, ํ…Œ์ŠคํŠธ ๋ฆฌํŒฉํ† ๋ง (ํ”„๋กœ๋•์…˜ ์ฝ”๋“œ ๋ณ€๊ฒฝ์ด ์—†๋Š” ๊ฒฝ์šฐ)
  • Chore: ๋นŒ๋“œ ์ž‘์—… ์ˆ˜์ •, ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ € ์„ค์ • ๋“ฑ (ํ”„๋กœ๋•์…˜ ์ฝ”๋“œ ๋ณ€๊ฒฝ์ด ์—†๋Š” ๊ฒฝ์šฐ)
  • Etc: ๊ธฐํƒ€

The Subject

  • ํƒ€์ž…์€ ์˜์–ด๋กœ ์ž‘์„ฑํ•˜๋ฉฐ, ๋Œ€๋ฌธ์ž๋กœ ์‹œ์ž‘ํ•œ๋‹ค.
  • ์ œ๋ชฉ์€ 50์ž๋ฅผ ๋„˜๊ธฐ์ง€ ์•Š์œผ๋ฉฐ, ํ•œ๊ธ€๋กœ ์ž‘์„ฑํ•œ๋‹ค.
  • ๋์— ๋งˆ์นจํ‘œ๋ฅผ ๋ถ™์ด์ง€ ์•Š์œผ๋ฉฐ, ๊ณผ๊ฑฐํ˜•์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค.

The Body

  • ์„ ํƒ ์‚ฌํ•ญ
  • ๋ถ€์—ฐ ์„ค๋ช…์ด ํ•„์š”ํ•˜๊ฑฐ๋‚˜, Commit์˜ ์ด์œ ๋ฅผ ์ž‘์„ฑํ•œ๋‹ค.
  • ์ œ๋ชฉ๊ณผ ๊ตฌ๋ถ„ํ•˜๊ธฐ ์œ„ํ•ด ํ•œ ์นธ ๋„์›Œ ์ž‘์„ฑํ•œ๋‹ค.
  • ํ•œ ์ค„์— 72์ž๋ฅผ ๋„˜๊ธฐ์ง€ ์•Š๋Š”๋‹ค.

The Footer

  • ์„ ํƒ ์‚ฌํ•ญ
  • Issue tracking์ด ํ•„์š”ํ•  ๋•Œ ์ž‘์„ฑํ•œ๋‹ค.

Example Commit Message

Feat: 50์ž ์ด๋‚ด๋กœ ๋ณ€๊ฒฝ ์‚ฌํ•ญ ์š”์•ฝ

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.

Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequences of this
change? Here's the place to explain them.

Further paragraphs come after blank lines.

 - Bullet points are okay, too

 - Typically a hyphen or asterisk is used for the bullet, preceded
   by a single space, with blank lines in between, but conventions
   vary here

If you use an issue tracker, put references to them at the bottom,
like this:

Resolves: #123, #124
See also: #456, #789

Reference