I can't delete the "cloned" folder with Case-Sensitive in my GitHub repository

I created a repository on Github and sent my application containing an X folder with the whole name in lowercase, when in fact the first letter of the name should be uppercase.

To solve this problem, I ran the following command:

git config core.ignorecase false

I managed to change the folder name and gave push to the repository. The problem is that on GitHub, the folder with the name in lowercase remains there, along with the folder in upper case. Example:

folder/
Folder/
file.txt

When I give a pull or clone to remove the lowercase folder, Git generates the following warning:

warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

And when I open the directory of my application, with the files and folders pulled from GitHub, here on the computer, only the folder with the name in uppercase appears, making it impossible for me to delete the folder with the lowercase name.

Folder/
file.txt

What do I do to delete the folder with the old name?

Author: JeanExtreme002, 2020-12-20

1 answers

You cannot access the two folders in the same directory due to its operating system, which does not differentiate files and directories of the same name with lowercase or uppercase letters.

A quick solution to this problem is to rename the old directory to another name, such as tmp, using the git mv <old_name> <new_name> Command. After that, rename the same folder again to the name of your current folder.

This Way, Git will merge the old folder with the current folder and delete the old directory, leaving only the current one. Following your example, try running the codes below:

$ git mv folder tmp
$ git mv tmp Folder
$ git status
 1
Author: JeanExtreme002, 2020-12-20 22:33:38