본문 바로가기

개발(합니다)/OS&Dev&Infra&AWS

[git] 커밋 메시지로 Git 플랫폼 이슈(issue) 자동 종료하는 방법

반응형

개발해야하는 내용들을 Github나 GItLab에서 이슈를 등록하고 개발이 완료 되면 이슈를 닫습니다.

이슈를 등록은 해당 플랫폼에 들어가서 등록해야 하지만 닫는건 커밋과 동시에 닫을 수 있습니다.

gitlab 관련 정보입니다.
https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#disabling-automatic-issue-closing

이슈 닫는 방법

명령어

키워드와 #이슈번호를 커밋 메시지에 같이 적어주면 이슈 종료로 인식합니다.

키워드 #이슈번호

키워드

  • Close, Closes, Closed, Closing, close, closes, closed, closing
  • Fix, Fixes, Fixed, Fixing, fix, fixes, fixed, fixing
  • Resolve, Resolves, Resolved, Resolving, resolve, resolves, resolved, resolving
  • Implement, Implements, Implemented, Implementing, implement, implements, implemented, implementing

예시

Fix #20, Fixes #21 and Closes group/otherproject#22.
This commit is also related to #17 and fixes #18, #19
and https://gitlab.example.com/group/otherproject/issues/23.

 

 

주의 사항

주의 할 점은 닫을 수 있는 브런치를 지정되어 있는지 확인합니다.

Gitlab을 기준으로 Default branch에서 이슈를 자동으로 닫을 브런치에 해당 이슈를 닫는 명령어를 가진 커밋이 있어야지 닫힙니다.
예를 들어 product 브런치에서 개발 후 close #1 커밋을 해도 닫히지 않고 product 브런치를 develop에 merge해야 닫힙니다.

반응형