This is so confusing. It is easier to show using the shell commands.
Note that my ~/.gitconfig
specifies excludesfile = /home/I063510/.gitignore
in section [core]
check why .p12 is ignored, pipe to sed to mask my user id
$> git check-ignore -v check.p12 | sed -n 's,/home/[^/]*,~,p'
~/.gitignore:11:*.war check.p12
comment out the line with pattern ^*.war
and verify the .p12 file is not ignored now
$> sed -i.orig 's,^*.war,#&,' ~/.gitignore
$> git check-ignore -v check.p12 | sed -n 's,/home/[^/]*,~,p'
$>
restore original file and verify .p12 is ignored
$> mv -f ~/.gitignore.orig ~/.gitignore
$> git check-ignore -v check.p12 | sed -n 's,/home/[^/]*,~,p'
~/.gitignore:11:*.war check.p12
git version:
$> git --version
git version 2.17.0
UPDATE
I tried portablegit based on VonC's answer and see the same result:
# git check-ignore -v check.p12
# git config core.excludesfile c:/temp/.gitignore
# git check-ignore -v check.p12
c:/temp/.gitignore:1:*.war check.p12
# git --version
git version 2.20.1.windows.1
UPDATE 2
Forgot to mention, this happens only for the pattern in ~core.excludesfile~
, not in ~core.workdir~/.gitignore