Change case to lowercase for committed files

Stefan Baumgartner

Stefan on Mastodon

More on Git

It’s super-annoying that the Mac’s file OS is case insensitive. Especially if you have a *NIX based server that can’t read your images and things like that. Just renaming it on the file system won’t work, you have to rename it via Git itself:

git mv OldFileName.jpg newfilename.jpg

With this little script you can do lowercase all the files in a directory, ready to commit:

for f in *; do git mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done

More articles on Git

Reverting a single file

Stay up to date!

3-4 updates per month, no tracking, spam-free, hand-crafted. Our newsletter gives you links, updates on fettblog.eu, conference talks, coding soundtracks, and much more.