We are using a remote Git repository located on a Linux server at the office. All clients are Windows PCs with Git Extensions installed as a client (running with msysgit).
How to make “git branch” respect the “core.ignorecase” flag on Linux?
You can't, because the flag doesn't do what you think it does.
core.ignorecase
If true, this option enables various workarounds to enable git to work better on filesystems that are not case sensitive, like FAT.
core.ignorecase
has nothing to do with the behaviour you're describing, it is unrelated to the case-sensitivity of branch names. Git being unable to tell the difference between Branch1
and branch1
on Windows isn't related to whether core.ignorecase
is set, it would behave the same way regardless.
... but either the flag does nothing on Linux systems, or I missed something.
You didn't miss anything. The flag does nothing on Linux systems. core.ignorecase
isn't for making operating systems case-insensitive, it's for allowing Git to work on broken case-insensitive operating systems. Linux is fundamentally case-sensitive, and so is Git. You should be trying to work with this, and mandating that your developers use lower-case for their branch names. You should not be trying to make Git emulate broken behaviour from other operating systems.
What would happen if two developers create branches with the same name, but different case, and push the result on the Linux repository?
Then you would have two completely different branches, one in lower-case and one which was wrongly named, and somebody would be forced to merge and discard their wrong branch. This is something you'll be doing routinely anyways, as a side-effect of using Git.