HeadlinesBriefing favicon HeadlinesBriefing.com

Git case rename breaks production

DEV Community •
×

A developer renamed a file from DEV.html to dev.html on Windows. Git didn't register the change because the Windows filesystem is case-insensitive. The commit pushed to GitHub without errors, but the server, running on Linux, still served the old filename. This led to broken links and 404 errors in production, despite everything working locally.

This highlights a classic cross-platform pitfall. Windows and macOS treat filenames as case-insensitive by default, while Linux systems are case-sensitive. Git on Windows doesn't detect case-only renames, so the change never gets recorded. The mismatch between local development and server environments created a hidden bug that only appeared in deployment.

The lesson is to enforce strict naming conventions. Always use lowercase for filenames and explicitly use `git mv` for renames to ensure Git tracks the change. Developers can add pre-commit hooks or CI checks to catch these issues before they reach production, preventing the frustrating 'works on my machine' scenario.