기술 개발

Git diff pptx, xlsx

겨울꿈개발자 2020. 9. 14. 22:42

Git을 통해 ppt나 xlsx 문서를 관리하고 있었습니다.

원래 pptx, xlsx 같은거는 바이너리 파일로 인식되기 때문에 diff를 해도 바뀐 내용을 확인할 수 없습니다.

 

다음 url들을 참고하여 해결하였습니다.

 

1. ppt

stackoverflow.com/questions/32259943/is-it-possible-to-diff-powerpoint-version-controlled-with-git

 

Is it possible to diff PowerPoint version-controlled with git?

I have some PowerPoint documents that I keep version-controlled with git. I want to know what differences are between versions of a file. Text is most important, images and formatting not so much (at

stackoverflow.com

- Node.js 설치

- cmd 창 열고 "npm install --global textract" 입력해서 textract 설치

- git config 에 아래 내용 추가 (모든 Git 레포지토리에 적용 "git config --global --edit")

   [diff "textract"]

      binary = true

      textconv=textract.cmd

- git attribute에 아래 내용 추가 (~/.config/git/attributes 또는 .git/info/attributes 파일 수정)

  *.pptx diff=textract

 

2. xlsx

gist.github.com/hkuno9000/f9244d923ebf69de11d4

 

How to git diff for MS-Excel files(xls/xlsx) on Windows-OS

How to git diff for MS-Excel files(xls/xlsx) on Windows-OS - git-diff-excel.md

gist.github.com

- 위의 url 대로 따라하면 됩니다.

- xdoc2txt.exe 파일에 대한 환경 변수 설정을 해줘서 cmd 창에서 xdoc2txt를 입력하였을때 동작해야 합니다.