개발/Git

[Github] Pull Request 템플릿 만들기

선우. 2024. 3. 19. 00:43

PR 템플릿 생성하기

PR 템플릿은 반드시 default 브랜치에 생성해야 합니다. 다른 브랜치에 생성할 경우 사용할 수 없습니다. 파일 저장 경로는 다음 세가지 중 하나로 설정하면 되며, 파일 명은 대소문자를 구분하지 않습니다.

  • docs/pull_request_template.md
  • .github/pull_request_template.md
  • pull_request_template.md (루트)

 

PR에 들어가면 좋은 내용

  • 이슈 넘버: 어떤 이슈에 대한 PR인지
  • PR 유형: 기능 추가, 버그 수정, 빌드 파일 관련, 질문 등
  • 주요 변경 사항: 변경 사항에 대한 간단한 브리핑
  • 리뷰 시 유의 사항: 팀원들이 코드리뷰할 때 주의 깊게 봐야할 포인트

다음은 참고하기 좋은 PR 예시입니다.

 

PR 템플릿 활용 예시

pull_request_template.md

저는 템플릿 작성 가능 경로 세가지 중 .github invisible 디렉토리에 pull_request_template 마크다운 파일을 작성했습니다.

 

Open PR

실제로 풀 리퀘스트를 Open 하면 템플릿이 적용된 것을 확인할 수 있습니다.

 

 

Creating a pull request template for your repository - GitHub Docs

When you add a pull request template to your repository, project contributors will automatically see the template's contents in the pull request body.

docs.github.com