How to fix ‘git encountered old-style’ warning

A quick fix for this warning in git CLI
Published on August 11, 2024 in How-tos
Read time: 1 min
Tags:

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

  1. go to your .gitconfig in $HOME
  2. edit to prepend %(prefix) to settings like hooksPath.
  3. save file, and try your git command again.

Why?

Curious about why it happens? Read more here.

I hope it helps. Thanks for reading.



Comments

Got some words you want to share? Tell me!