iamjonesy
iamjonesy

Reputation: 25122

Changed case of filename but GIT won't forget the old version

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.

Upvotes: 1

Views: 190

Answers (1)

Anjaneyulu Battula
Anjaneyulu Battula

Reputation: 1960

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

Upvotes: 1

Related Questions