커밋 메시지 작성 가이드: Conventional Commits와 gitmoji

협업을 위한 커밋 메시지 규칙 이해하기

Table Of Contents

TL;DR

Conventional Commits 사용법

<type>[optional scope]: <description>

0. 들어가기

처음으로 (업무를 제외한) 개발 팀 프로젝트를 하게 됐다🥹

팀원들과의 협업을 원활하게 하기 위해 일관성 있는 commit message 작성법을 알아보고자 한다!

 

가장 보편적으로 사용되는 commit message 규칙인 Conventional Commits, 그리고 gitmoji에 대해 알아보자.

Conventional Commits은 커밋 메세지에 커다란 변화, 신규 기능 추가, 문제 수정이 있음을 기술하는데, 이는 Semantic Versioning과 밀접하게 연결되어 있다. 따라서 Semantic Versioning에 대해 먼저 살펴보자.

1. Semantic Versioning(의미적 버전 관리)

의미적 버전 관리란, 소프트웨어 버전을 체계적으로 관리하기 위한 규칙이다.

예를 들어, v101처럼 사용하면 이번 버전에서 어떤 변경 사항이 있었는지 잘 드러나지 않지만, 5.3.1처럼 사용하면 변경 사항을 잘 전달할 수 있다.

형식

Major.Minor.Patch

버전 번호는 음이 아닌 정수를 사용한다.

1. Major

2. Minor

3. Patch

pre-release

build metadata

장점

2. Conventional Commits

Conventional Commits은 명시적인 commit을 남기기 위한 규칙이다.

위에서 서술한 것처럼, Conventional Commits은 신규 기능 추가, 문제 수정, 커다란 변화가 있었음을 기술한다.

사용법

<type>[optional scope]: <description> [optional body] [optional footer(s)]

1. type

2. scope

3. description

4. body

5. footer

예시

fix: prevent racing of requests Introduce a request id and a reference to latest request. Dismiss incoming responses other than from latest request. Remove timeouts which were used to mitigate the racing issue but are obsolete now. Reviewed-by: Z Refs: #123

장점

gitmoji

깃모지 역시 commit 메세지를 표준화하기 위한 규칙이다.

이모티콘을 사용하면 commit 목적이나 의도를 쉽게 알아볼 수 있다.

사용법

사용법은 Conventional Commits와 매우 유사하다. 각 부분에 대한 설명은 위를 참고하면 좋을 것 같다.

<intention> [scope?][:?] <message>

예시

참고