Thanks for all the comments above. I found the location of pre-commit file. It uses shell script to find java path. So I cannot run git in powershell, but only MINGW64.
pre-commit