💡 Git 커밋 메시지 컨벤션의 중요성

커밋 메시지 컨벤션을 지키는 것은 프로젝트 관리와 협업에 있어서 중요한 부분이다.

정해진 규칙에 따라 커밋 메시지를 기재함으로써 개발자들이 서로의 작업을 이해하고 효율적으로 대처할 수 있는 프로제젝트 환경을 만들 수 있다.

⇒ Git 커밋 메시지 작성 원칙을 정하고 일관성 있게 작성하면 프로젝트를 보다 효율적이고 안정적으로 관리할 수 있다!

 

Udacity Git Commit Message Style Guide

이 스타일 가이드는 프로젝트에서 따를 공식 가이드로 작용합니다. Udacity 평가자는 이 가이드를 사용하여 프로젝트를 평가합니다. 개발 분야에서는 "이상적인" 스타일에 대해 많은 의견이 있습니다. 따라서 학생들이 프로젝트 진행 중에 어떤 스타일을 따를지 혼동을 줄이기 위해 모든 학생들에게 이 스타일 가이드를 참고하도록 권장합니다.

 

1. Message Structure

커밋 메시지는 제목, 본문, 꼬리말로 구성된다 :

type: Subject # 제목

body # 본문(선택)
 
footer # 꼬리말(선택)

 

2. Commit Type

  • feat : 새로운 기능 추가
  • fix : 버그 수정
  • docs : 문서 수정
  • style : 코드 포맷팅, 세미콜론 누락, 코드 변경이 없는 경우
  • refactor : 코드 리펙토링
  • test : 테스트 코드, 리펙토링 테스트 코드 추가
  • chore : 빌드 업무 수정, 패키지 매니저 수정

 

3. Subject

  • 제목은 50자를 넘기지 않고, 대문자로 시작하고 마침표를 붙이지 않는다.
  • 과거시제를 사용하지 않고 명령어로 작성한다.
    • “Fixed” → “Fix”
    • “Added” → “Add”

 

4. Body

  • 모든 커밋이 복잡한 내용을 포함할 필요는 없으므로, 본문은 선택사항이다.
  • 추가 설명과 문맥을 필요로 할 때에만 사용된다.
  • ‘무엇’을 ‘왜’ 했는지 기재하고, ‘어떻게’는 설명하지 않는다.
  • 제목과 본문 사이에 빈 줄을 넣어야 하며, 각 줄의 길이는 72자는 넘지 않는다.

 

5. Footer

  • 선택사항이다.
  • issue tracker ID를 작성할 때 사용한다.
  • issue tracker ID란? → GitHub 이슈 탭에서 확인 가능
  • 참고 - Github 이슈 트래커 작성
 

Github 이슈 트래커 작성

이슈 트래거는 버그 보고, 기능 개선 건의 등 프로젝트에 관련된 주제를 등록할 수 있는 게시판이다 아래 사진은 https://github.com/leggedrobotics/darknet_ros/issues darknet_ros의 이슈 트래거 사진이다 이슈

noel-embedded.tistory.com

 

6. Example Commit Message

feat: Summarize changes in around 50 characters or less

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
See also: #456, #789

 

(참고) 유다시티 커밋 메시지 스타일 가이드

Udacity Nanodegree Style Guide

 

Udacity Nanodegree Style Guide

Introduction This style guide acts as the official guide to follow in your projects. Udacity evaluators will use this guide to grade your projects. There are many opinions on the "ideal" style in the world of development. Therefore, in order to reduce the

udacity.github.io

 

+ Recent posts