I'm working on a team with mixed Linux/MacOS developers. MacOS is case insensitive while Linux is case sensitive. I've got the following issue:
My (MacOS) machine:
$ git checkout master
$ echo hi > MyModule.js
$ git commit -a -m 'Create MyModule.js'
$ git push origin master
$ git checkout -b other-work
... (do work)
Coworker's (Linux) machine
$ git checkout master
$ git pull
$ git mv MyModule.js myModule.js
$ git commit -m 'Rename MyModule.js to myModule.js'
$ git push
My (MacOS) machine
# Currently on branch other-work
$ git fetch
$ git checkout origin/master
error: The following untracked working tree files would be overwritten by checkout:
MyModule.js
# In order to resolve the issue, I have to resort to hackery:
$ rm MyModule.js
$ git checkout origin/master
$ git checkout -- myModule.js # Restore the rm'd file
I'd really like to avoid all of this hackery. I want my MacOS git to be aware of case changes in file names so that so that I can switch between branches freely. I've tried setting the ignorecase
config value to both true and false but this does not help.