I was reviewing my ~/.gitconfig after attending a Git training session in my company. The file was mostly inherited from some source on Internet long time ago, and I hadn't carefully reviewed all the settings there before. I realized that there's an explicit core.ignoreCase setting:

[core]
    ignoreCase = true
    ...

Now I'm not entirely sure if this is a good idea.

My observations:

On my Mac computer which has the default case-INsensitive file system, no matter if ignoreCase = true or false,

  • git mv myfile myFile does NOT work;
  • 'mybranch' and 'myBranch' branches can NOT coexist.

However, on my Linux computer which has case-sensitive file system, no matter if ignoreCase = true or false,

  • git mv myfile myFile works, and git status lists it as a commitable change, and moreover if committed and pushed, it can be checked out and reflected on the Mac computer;
  • 'mybranch' and 'myBranch' branches can NOT coexist.

It seems having explicit ignoreCase setting does not make a difference on the same computer, but the behaviors between Mac and Linux differs. From reading the documentation on core.ignoreCase (https://git-scm.com/docs/git-config), I just couldn't decide if keeping ignoreCase = true in my global ~/.gitconfig is helpful or harmful.

blog comments powered by Disqus