Using git version 2.35.1.windows.2, all Git invocations include this warning at least once:
PS C:\Users\BoppreH\Desktop\source\keyboard> git status
warning: encountered old-style '/home/boppreh/.gitignore' that should be '%(prefix)/home/boppreh/.gitignore'
On branch new_core
Your branch is up to date with 'origin/new_core'.
[...]
Sometimes multiple times:
PS C:\Users\BoppreH\Desktop\source\keyboard> git pull
warning: encountered old-style '/home/boppreh/.gitignore' that should be '%(prefix)/home/boppreh/.gitignore'
warning: encountered old-style '/home/boppreh/.gitignore' that should be '%(prefix)/home/boppreh/.gitignore'
warning: encountered old-style '/home/boppreh/.gitignore' that should be '%(prefix)/home/boppreh/.gitignore'
warning: encountered old-style '/home/boppreh/.gitignore' that should be '%(prefix)/home/boppreh/.gitignore'
warning: encountered old-style '/home/boppreh/.gitignore' that should be '%(prefix)/home/boppreh/.gitignore'
Already up to date.
Which is confusing, because I'm on Windows and there's no .gitignore
file in my home folder.
What is causing this warning?
For the latest git
releases for Windows, prepending %(prefix)
on any root file-reference is suggested.
Otherwise you will get the warning that you are referring to. The amount of times that you will get it depends on the git
command that you are running. Which effectively reflects the number of times that such references in your .gitconfig
file are parsed.
I believe if you update the offending line as below, you will not get the warning message.
[core]
excludesfile = %(prefix)/home/boppreh/.gitignore
BTW with Git for Windows v2.35.3 there was a bug-fix released that was related to %(prefix)
when using Windows Subsystem for Linux (WSL).
Might be related with your case if you add the prefix and you are still getting the warning.
A simple ~
in the file name solved this for me, with the added benefit that it works on Windows and Unix.
[core]
excludesfile = ~/.gitignore
The warning should be gone.
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