Git-windows case sensitive file names not handled properly

前端 未结 6 824
慢半拍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条回答
  •  -上瘾入骨i
    2020-12-13 18:44

    I just encountered a similar problem. In my case, the two files with similar names differing only in case were in a subdirectory that wasn't relevant on the Windows clone. Git 1.7 has a sparse checkout feature that lets you exclude certain files from a working copy. To exclude this directory:

    git config core.sparsecheckout true
    echo '*' >.git/info/sparse-checkout
    echo '!unwanted_dir/' >>.git/info/sparse-checkout
    git read-tree --reset -u HEAD
    

    After this, the unwanted_dir/ subdirectory was completely gone from my working copy and Git continues to work with the rest of the files as normal.

    If your GRANT.sql and grant.sql are not relevant on the Windows clone, then you can add their names to .git/info/sparse-checkout to exclude those files specifically.

提交回复
热议问题