git能对docx进行版本管理嘛

发布于 2021-11-27 03:56:53 字数 158 浏览 990 评论 17

@蓝桥书生 你好,想跟你请教个问题:

git对docx进行版本管理的时候 无法得到版本的批注信息

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(17

甜扑 2021-12-01 06:59:43

可以管理,word现在自带的diff功能

谁的新欢旧爱 2021-12-01 06:59:42

我们公司有数据加密软件,word,excel这些估计加密后都是二进制了~版本管理肯定没问题,只是内容比较吧

酒几许 2021-12-01 06:59:39

谢谢你

墨洒年华 2021-12-01 06:59:39

因为批注是在其他的xml文件中写的,git diff 只支持了主要内容的xml的 diff,所以出现这种情况,这个你得想起他办法了

鹤舞 2021-12-01 06:59:37

这是初始的时候  word只有这一段话后来我新增了一句话,并做了一个批注。查询版本差异如下:

眼泪淡了忧伤 2021-12-01 06:59:35

直接在word正文中做修改 git diff 能检测到修改 但是审阅——批注的方式 就读不到批注内容

猫烠⑼条掵仅有一顆心 2021-12-01 06:58:45

先生 我的具体问题如下一个评论图所示 求解

因为看清所以看轻 2021-12-01 06:58:39

这个问题很容易解决,只要添加一个 .gitattributes

内容如下:

# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs     diff=csharp
*.sln    merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc	 diff=astextplain
*.DOC	 diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot  diff=astextplain
*.DOT  diff=astextplain
*.pdf  diff=astextplain
*.PDF	 diff=astextplain
*.rtf	 diff=astextplain
*.RTF	 diff=astextplain

git 完全支持 docx 文件的差异对比,因为 git 内部也是使用了 zlib,docx 本质上是 zip 文件,比较差异还是很容易的。

http://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes 

谢绝鈎搭 2021-12-01 06:58:33

docx的diff工具??你是说用在git里面的 docx的diff包?是这个意思吗?

叹沉浮 2021-12-01 06:56:09

回复
http://blog.martinfenner.org/2014/08/25/using-microsoft-word-with-git/,这篇是用pandoc来做的

拥有 2021-12-01 06:55:23

可以的,只是你得去找个docx的diff工具

泪冰清 2021-12-01 06:36:28

这个得用sharepoint吧。

秉烛思 2021-12-01 05:47:08

你是将word用程序转成markdown?还是说 手动写?

别低头,皇冠会掉 2021-12-01 04:46:03

不行滴,所以我一般将文档写成makedown格式

怎言笑 2021-11-30 15:18:08

docx不是一个xml的zip吗 我昨晚测试 在正文里面做修改 可以被git管理 但是如果是对正文做批注 就看不到了

惜醉颜 2021-11-30 10:29:24

docx不是纯文本文件,只能当成二进制文件来管理。

把回忆走一遍 2021-11-29 04:10:10

引用来自“Force武装卫队”的评论

这个问题很容易解决,只要添加一个 .gitattributes

内容如下:

# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs     diff=csharp
*.sln    merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc	 diff=astextplain
*.DOC	 diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot  diff=astextplain
*.DOT  diff=astextplain
*.pdf  diff=astextplain
*.PDF	 diff=astextplain
*.rtf	 diff=astextplain
*.RTF	 diff=astextplain

git 完全支持 docx 文件的差异对比,因为 git 内部也是使用了 zlib,docx 本质上是 zip 文件,比较差异还是很容易的。

http://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes 

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文