Git-windows case sensitive file names not handled properly

前端 未结 6 828
慢半拍i
慢半拍i 2020-12-13 17:54

We have the git bare repository in unix that has files with same name that differs only in cases.

Example:

GRANT.sql
grant.sql

When

6条回答
  •  旧巷少年郎
    2020-12-13 18:34

    The simplest way to actually fix the issue is to rename one of the files so that they won't conflict on a case-insensitive file system like Windows or OS X.

    Following a commit from the Linux/Unix system where you can most easily address the problem everything will be fine on Windows after a pull. To prevent this problem from occurring you would need to add a commit hook similar to what djjeck suggested.

    The symptoms on Windows for this are very confusing and include:

    • Files that always show as changed even if you revert them which makes changing branches or rebasing very difficult.
    • Two copies of the file with the names differing only in case both showing changes in git gui

    Since both files can not coexist on a case insensitive platform you have to change one of the file names to avoid the trouble.

提交回复
热议问题