使用 git 来版本控制 word 文档
· 73 words · ~ 1 min read
安装 pandoc
安装教程
Pandoc User’s Guide
1
2
3
4
|
# macos
brew install pandoc
# debian
sudo apt install pandoc -y
|
修改 gitconfig 文件
创建或编辑 ~/.gitconfig (linux, Mac) 文件,添加如下代码
1
2
3
4
5
|
[diff "pandoc"]
textconv=pandoc --to=markdown
prompt = false
[alias]
wdiff = diff --word-diff=color --unified=1
|
编辑 gitattributes 文件
在 word 文件目录创建或编辑.gitattributes 文件,添加如下代码
commit 后命令查看 word 修改
查看所有修改
1
|
git log -p --word-diff=color file.doc
|
#Git