1

Due to upgrading an app to be PSR-0 complient (uppercase class file names) I have changed classes to have uppercase filename. ie. users.php has become Users.php. That's worked fine and git has noticed the changes and pushed to the remote repo.

My problem is that if I now change the contents of Users.php at all. Both the old users.php and new Users.php appear as changed files to be staged.

How do I get git to forget about the lowercase version of the file?

Note. I'm using osx which ignores casing.

iamjonesy
  • 24,732
  • 40
  • 139
  • 206
  • Possible duplicate of [I change the capitalization of a directory and Git doesn't seem to pick up on it](http://stackoverflow.com/questions/6899582/i-change-the-capitalization-of-a-directory-and-git-doesnt-seem-to-pick-up-on-it) (and see also: [Git: Changing capitalization of filenames](http://stackoverflow.com/questions/10523849)) – Paul R Sep 24 '14 at 10:36
  • Git has picked up the change. It's just that now both files seem to exist (although only in git) – iamjonesy Sep 24 '14 at 10:39

1 Answers1

1

In your Git repository if have two files Users.php, users.php

  • if you donot want users.php file you can remove that file from your git repository by using the following command git rm filename
  • To untrack a single file that has already been added/initialized to your repository, i.e., stop tracking the file but not delete it from your system use: git rm --cached filename
Anjaneyulu Battula
  • 1,910
  • 16
  • 33