Git commit fails with `grep: -P supports only unibyte and UTF-8 locales`

Viewed 366

I'm using Windows 10 and git 2.27.0.windows.1. I'm working with Git using the CMD.

Running git commit -m "things" causes the following:

grep: -P supports only unibyte and UTF-8 locales
grep: -P supports only unibyte and UTF-8 locales

The commit doesn't seem to be commited.

I know of this other question, but the answer there doesn't seem to explain the problem at all. Guidance as to what's going on and how to solve it would be appreciated.

1 Answers

If this is not linked to a pre-commit, try the same git commit in a CMD where you have set a simplified PATH, in order to exclude any other grep you might have (like one from Cygwin)

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
Related