# Bruce 的玩具間

## Git: How to rename a file or folder into different case (case-sensitive)

Yesterday I carelessly made a typo on case of directory name. Result in Rails can't find file correctly. But when I try to rename it. I found out that git doesn't recognize a change that same name in differ case (case-insensitive).

Althought I can run this

to make git case-sensitive. But this can cause unexpected consequence on other projects.

I read some tutorials（How do I rename a file in git that differs by case only?
git mv and only change case of directory

And this is my final solution：

In some tutorials, they commit on "typo_temp" step. While I just put it in staging area, it still work.

BTW, the mistake I made is:

I want /users routes to /app/controller/api/users_controller (like scope :module). The purpose is to remain API url but move code file to a sub directory.

But, Yes, I made the typo on api/ folder (as Api/)

The strange thing is, it works on my laptop. But throws this expection on production machine:

Why it doesn't break on my laptop!? Really strange @_@