0

I renamed my file

 appliances.html.erb  =>  Appliances.html.erb

and, i sent push to server. The file name doesn't changed on server but content does.

I checked .gitignore and .gitignore-global. This file wasn't there.

It seems like, the file is updating on server but the filename isn't.

Hows that possible ? and how to fix it ?

EDIT: After doing

git mv  app/views/landing_pages/appliances.html.erb  app/views/landing_pages/Appliances.html.erb`

fatal: destination exists, source=app/views/landing_pages/appliances.html.erb, destination=app/views/landing_pages/Appliances.html.erb

`

Paritosh Piplewar
  • 7,982
  • 5
  • 26
  • 41

3 Answers3

3

OS X is the issue -- or rather, its filesystem, HFS+. It's case-preserving, but not (in classic Unix style) case-sensitive. So the two variations on filenames are considered the same, at some point in the process of git trying to rename them.

This obviously isn't a completely fatal issue, since it's possible in OS X to perform an operation like "mv filename Filename". But "mv filename filename" fails. Where it gets interesting is that -- with and only with a case-preserving filesystem -- you can have a file named "Filename", and something like "mv filename fileName" will still rename it.

I ran into this issue myself, and I'm sorry to say that I never did really figure out how to fix it on my Mac. I ended up doing the commit on the repo I'd cloned from, which was on a Linux box with an ext3 filesystem. Then I deleted the problem file on my Mac, pulled the changes, and recreated it with the new case that way, IIRC.

William McBrine
  • 2,166
  • 11
  • 7
  • ehh, thankfully i found it. i used `forced` flag and it worked. more here http://stackoverflow.com/questions/10523849/git-changing-capitalization-of-filenames – Paritosh Piplewar Aug 12 '14 at 21:44
0

Did you git rm appliances.html.erb and git add Appliances.html.erb?

squadette
  • 8,177
  • 4
  • 28
  • 39
0

Hows that possible ?

Read https://stackoverflow.com/a/25274416/1377943

how to fix it ?

Just use force flag. So, in this case

git mv  app/views/landing_pages/appliances.html.erb  app/views/landing_pages/Appliances.html.erb -f
Community
  • 1
  • 1
Paritosh Piplewar
  • 7,982
  • 5
  • 26
  • 41