views:

178

answers:

2

There are a couple of files in our git-controlled codebase that I'd like to rename. Specifically, I just want to change the case of the file, so that sourceCode.java becomes SourceCode.java, for example. The catch: I'm on a Windows box, and the filesystem thinks those are the same file name.

How can I get Windows and git to recognize that change and check it in?

+2  A: 

Unless you can do the rename on a *nix box your only choice is to do a two stage rename:

  1. Rename sourceCode.java to anything.you.like
  2. Rename anything.you.like to SourceCode.java

Back in the days when we used Perforce we had exactly this problem and this was the only solution we could come up with.

ChrisF
+4  A: 

Have a look here for more hints on how to do it:

http://stackoverflow.com/questions/52950/how-to-make-git-ignore-changes-in-case

Or:

git mv -f name.java Name.java
Igor Zevaka
That did the trick! Thanks, Igor.
Electrons_Ahoy
As an aside this doesn't work on a FAT filesystem. I carry some project code around on a thumb drive and case changes are a real pain.
Andrew Myers