How to fix ‘git encountered old-style’ warning
A quick fix for this warning in git CLI
Git is a very powerful piece of software, capable of tracking thousands of files. Still, sometimes it has its own quicks.
Problem
If you are reading this, you may have encountered an error like the one below:
warning: encountered old-style '/Users/francesco/dotfiles/git/hooks'
that should be '%(prefix)//Users/francesco/dotfiles/git/hooks’
Solution
- go to your
.gitconfigin$HOME - edit to prepend
%(prefix)to settings likehooksPath. - save file, and try your
gitcommand again.
Why?
Curious about why it happens? Read more here.
I hope it helps. Thanks for reading.