ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • git 메시지 작성 도움말
    설치&설정 관련 2020. 6. 13. 22:18
    728x90

    Udacity Git Commit Message Style Guide를 기초로 작성한 메시지 작성 규칙

    지금까지 git message가 귀찮아서 그냥 update 이런식으로 작성하였는데, 시간이 지나서 보면 내가 어떤 작업을 했었는지 알수 없습니다.

    엉망인 코멘트가 달린 로그를 보고 내가 원하는 시점으로 전환이 되지 않아 많이 불편해서 git 메시지를 아름답게 작성하는 노하우를 인터넷에 검색해보았습니다.

    우선 시작하기 전에 이런 방법도 있구나로 알고 있으면 좋습니다.

    메시지 구조

    메시지는 다음과 같이 작성합니다.

    type: subject
    
    body(options)
    
    footer(options)

    제목은 type과 subject로 구성됩니다.

    Type

    타입은 다음중 하나를 선택하여서 사용합니다.

    • feat: 새로운 기능
    • fix: 오류 수정
    • docs: 문서 수정
    • style: 코드의 변경 없이 포멧이나 ; 추가 등 작업;
    • refactor: 코드의 리펙토링 작업
    • test: 테스트를 추가 하거나, 리펙토링 작업을 진행한 경우; 운영 코드의 변화 없음
    • chore: 빌드 테스크 변화, 패키지 매니저 설정 등; 운영 코드의 변화 없음

    Subject

    • 주제는 50자를 넘어서는 안된다.
    • 이해하기 쉽게 명령조로 작성하세요.
    • 영어로 작성할 경우 변경을 작성할때, chage를 사용하고, changed 또는 changes를 사용하지 마세요.

    Body

    제목만으로 충분하지 않을 경우 사용합니다.
    제목과 Body 사이에는 빈공간 1칸을 두어서 구분해주세요.
    어떻게를 작성하지 말고, 무엇을 기준으로 작성하세요.
    또한 한 라인에 72글자를 넘지 않도록 작성하세요.

    Footer

    선택 사항이며, 이슈트레커의 IDs 나 참고 정보를 작성합니다.

    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 consequenses 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

    우선 간단하게 제목만이라도 적는 연습을 하다보면 좋은 결과를 얻을 수 있습니다.

    참고 자료

    728x90
Designed by Tistory.