How to Change File Names and Directory Names Case in Git

Tadashi Shigeoka ·  Thu, May 27, 2021

I’ll introduce how to change the case of file names and directory names in Git.

Git

Background: Development on macOS, Server on Linux

I occasionally encounter a pattern where I use uppercase letters in file names or directory names on macOS, which causes errors on Linux, so this is how to handle it.

git mv for Files

git mv -f Example.txt example.txt

git mv for Directories

git mv Example/ _Example/
git mv _Example/ example/

That’s all from the Gemba about wanting to change the case of file names and directory names in Git, which happens about once every few years.