brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: core.quotePath false shows accented file names in git as they are

Git
~/tips/tip-git-core-quotepath-unicode-names

git config --global core.quotePath false

Stops git from printing names like café as octal escape codes.

A file called café menü.txt shows up in git output as "caf\303\251 men\303\274.txt". Git is being careful with bytes above ASCII, but nobody can read that.

git config --global core.quotePath false

With core.quotePath set to false, commands like git status, git diff --name-only and git ls-files print those names with the real characters. The default, true, escapes every byte above 0x80 as an octal code and puts the name in double quotes.

$ git diff --cached --name-only
"caf\303\251 men\303\274.txt"
$ git -c core.quotePath=false diff --cached --name-only
café menü.txt

The second line shows a handy trick too: -c sets any config value for one command only, so you can try a setting before you make it permanent.

I’d turn this on for anything with Dutch, German or French file names, or emoji in folder names, which some photo exports love.

Names with truly odd characters, like a double quote, a backslash or a control character, are still quoted and escaped. That’s on purpose and keeps the output unambiguous. For scripts that read file names from git, don’t rely on this setting at all: use the -z option where a command has it, which separates names with NUL bytes and never quotes anything.

Further reading: git-config documentation: core.quotePath

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Git tips git show-branch main feature git log --stat -5 git merge --no-ff feature -m "Merge feature" git merge --squash feature git merge --abort All Git tips (144) All topics

Link