Skip to content
forked from ForNeVeR/ExtDiff

Compare documents using MS Word from the command line.

License

Notifications You must be signed in to change notification settings

xiaofami/ExtDiff

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExtDiff Status Aquana

This is a small command line script that will compare two files using Microsoft Word file comparison tool. Microsoft Word will be started using COM automation.

It is useful as a diff tool for Word-related file types.

Using via command line

To run the script, execute it through PowerShell like this:

$ powershell -File Diff-Word.ps1 oldfile.docx newfile.docx

Or via the batch file:

$ diff-word.cmd oldfile.docx newfile.docx

Using via Git Integration

You can also use this tool with git, so that git diff will use Microsoft Word to diff *.docx files.

To do this, you must configure your .gitattributes and .gitconfig to support a custom diff tool.

.gitattributes

To configure your .gitattributes, open or create a file called .gitattributes in your git repo's root directory. Add the following text to a new line in this file:

*.docx diff=word

It is also possible to create a global .gitattributes file that will be applied to every repository in a system. To do that, create a file .gitattributes in your home directory, and then perform the following command:

git config --global core.attributesfile ~/.gitattributes

.gitconfig

To configure your .gitconfig, open or create the file in your home directory. Then, add the following to your .gitconfig:

[diff "word"]
	command = <pathToExtDiffFolder>/diff-word-wrapper.cmd

Replace <pathToExtDiffFolder> with the path to this repo's location on disk.


Idea taken from TortoiseSVN diff-doc script.

About

Compare documents using MS Word from the command line.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 89.7%
  • Batchfile 10.3%