Git: rename directory (case-only) on Windows Git: rename directory (case-only) on Windows windows windows

Git: rename directory (case-only) on Windows


You can try to do it in 2 step.

$ git mv docs DOCS2$ git mv DOCS2 DOCS

it will work


Since windows iד case sensitive you cant rename the file to the same letters. (Docs == docs [ignored case])

You can do it from git bash since git bash is cygwin and its case sensitive since its a unix emulator.

The command is git mv

git mv <old name> <new name>

Here is a demo from git bash. (windows 7)enter image description here


No. There isn't a way to tell Git that you don't want to move the folder inside any other directory.

This is not a limitation of git, but rather a limitation of Windows and NTFS. Because the filesystem is case-insensitive, it reports that the case-changed new name already exists, which causes the behaviour that you encounter. Try a 2 step rename (with a temporary name), then commit, or changing it on a non-windows (technically on a case-sensitive filesytem) computer.