Title says it all: is it possible to get Git for Windows to pipe its output through cygwin's less so that it shows up correctly in a mintty window? There have been a number of questions asked about this, but still no definitive answer.
Arguably this kind of setup is a little esoteric, but
- I need cygwin because I'm using a build system that requires it;
- I don't want to use the git client that comes with cygwin because it is an order of magnitude slower when applying patches or rebasing, which is something I often need to do;
- I am aware that manually typing git show <whatever> --color=always | less -R
works, but I'm finding it hard to believe that the only working solution is to set up aliases like this for every git command I want paged and coloured output from.
It turned out to be surprisingly easy:git config --global core.pager 'C:/cygwin/bin/less.exe'
orgit config --global core.pager 'C:\\cygwin\\bin\\less.exe'
will both do the trick. (With the path adjusted to wherever your installation of cygwin lies.) I didn't find this at first because of the need for double backslashes within the quote; but forward slashes work fine too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With