Changing the filename with case change only using the unix command “mv” will not be detected in Git.
1 2 3 4 5 | $ mv classes/hello.php classes/Hello.php $ git add . $ git commit -a # On branch master nothing to commit, working directory clean |
The general advice is using the git sub-command “git mv” to rename files, when I type this I saw the below error
1 2 | $ git mv classes/hello.php classes/Hello.php fatal: destination exists, source=classes/hello.php, destination=classes/Hello.php |
It looks like the Mac file system is not case-sensitive, hence the error. The workaround is that, rename the file twice
1 2 3 | $ git mv classes/hello.php classes/Hello $ git mv classes/Hello classes/Hello.php $ git commit -a |
No complain from Git! Enjoy!