Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git pager set to diff-highlight does not work in Windows 10

Tags:

git

windows

pager

I have set Git's pager option to this

[pager]
    log = diff-highlight 

I downloaded the diff-highlight script from Git's repository 3dbfe2b8 and placed it in my ~/bin folder.

$ where git
C:\Program Files\Git\cmd\git.exe
$ where diff-highlight
C:\Users\andy\bin\diff-highlight

Running git log results in the following error:

$ git log
Can't open diff-highlight: No such file or directory at C:\Users\andy\bin\diff-highlight line 36.
Segmentation fault

On the other hand, the following command runs just fine,

$ git log -p --color | diff-highlight | less -FRSX

This means diff-highlight is available from $PATH, but Git's config cannot find it.

My Git version is 2.12.0.windows.1.

like image 330
Andrew-Dufresne Avatar asked Mar 09 '17 10:03

Andrew-Dufresne


1 Answers

Recent guidance suggests putting the whole diff-highlight | less -FRSX string into the pager.XXX config.

This works just fine for me with a Maked version of the current diff-highlight script, although I only use it for pager.diff and interactive.diffFilter.

like image 144
Michael Avatar answered Oct 18 '22 19:10

Michael