Have to say that the Git default does not distinguish between filename case is really a big pit, because before the project directory is disorderly, under the project folder name is not specification, this two days has been arrange, then today will project to clone from the server down and found that prior to all the file name initials into capital changes did not change, Git file names are not case sensitive by default.


  • Once you have created a repository, add a file called readme.md and then commit the push to the remote repository.

  • Then you change the file name locally to readme.md, and then you commit and find that there are no changes to commit.

  • Git is insensitive to filename case by default, so Git doesn’t notice any changes to filename case.

The solution

  • Open a terminalcdTo local projectsGitWarehouse, enter the following command to configureGitMake it case-sensitive to file names.
git config core.ignorecase false
Copy the code
  • Git will prompt you to commit when you change the case of the file name.

  • The local repository has only one file, and the file name is lowercase readme.md.

  • But it’s capitalized on the remote warehouseREADME.mdIt wasn’t deleted, it was in existence, andGitThere is also no prompt for any submission information, this is very pit.

  • What’s even worse is when you delete the local repository and then go back to the remote repositorycloneAnd when I came down, it was still only lowercasereadme.mdThis is a file.

  • As for why this happens, I do not know, can only wait for the god to explain, my solution is to put the original capital file firstREADME.mdDelete from the remote repository and then put the modifiedreadme.mdAdd it and submit the push.

Hopefully, the great God will come up with a more effective solution.

In the future, you will be grateful for your hard work now, and wish you and your readers a better way of development.

My portal: blog, Book, Twitter, GitHub.