EDIT: user Christian Brabandt points out that v:progpath will still only contain /usr/bin/vim when invoked through git-for-windows, so this solution will not work.
Maybe something along these lines?
if v:progpath =~ "git"
colorscheme default
endif
The variable v:progpath should contain a path to the running vim executable, and (assuming that the version of vim that git commit spawns is included in your git installation) =~ "git" should detect whether that executable is within git's installation directory. (This is all very hypothetical of course)
According to help v:progpath:
v:progpath Contains the command with which Vim was invoked, in a form
that when passed to the shell will run the same Vim executable
as the current one (if $PATH remains unchanged).
Useful if you want to message a Vim server using a
|--remote-expr|.
To get the full path use:
echo exepath(v:progpath)
If the command has a relative path it will be expanded to the
full path, so that it still works after `:cd`. Thus starting
"./vim" results in "/home/user/path/to/vim/src/vim".
On Linux and other systems it will always be the full path.
On Mac it may just be "vim" and using exepath() as mentioned
above should be used to get the full path.
On MS-Windows the executable may be called "vim.exe", but the
".exe" is not added to v:progpath.
Read-only.
has("win32unix")or perhaps check some environment variables – Christian Brabandt Jun 09 '21 at 15:55Sharelink found below it. :) – B Layer Jun 10 '21 at 19:10