카테고리 없음

[git] git diff 내역을 html 파일로 만들기

jaykwon 2023. 5. 24. 17:38

* 개요

: git과 jenkins를 연동하여 배포 실행 시 mail로 관리자에게 승인을 받는 절차를 만들어 두었다. 이 과정에서 관리자가 어디가 변경되었는지 확인을 하기 위해 git diff를 html 파일로 만들어서 메일에 첨부하면 어떨까 생각해 보며, 아래와 같이 해결 하였다.

 

* DEMO

https://diff2html.xyz/demo.html?matching=none&matchWordsThreshold=0.25&maxLineLengthHighlight=10000&diffStyle=word&renderNothingWhenEmpty=0&matchingMaxComparisons=2500&maxLineSizeInBlockForComparison=200&outputFormat=line-by-line&drawFileList=1&synchronisedScroll=1&highlight=1&fileListToggle=1&fileListStartVisible=0&highlightLanguages=[object%20Map]&smartSelection=1&fileContentToggle=1&stickyFileHeaders=1&diff=https://github.com/rtfpessoa/diff2html/pull/106 

* 적용 방법

# 필요 모듈 설치
npm install diff2html
# HTML 파일 생성
# 마지막 commit을 기준으로 파일비교
diff2html -F my-pretty-diff.html -- -M HEAD~1

* 참고 자료

https://github.com/rtfpessoa/diff2html-cli#readme