Reputation: 809
when I git clone the repository the following warning appears:
...
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
'components/User/index.js'
'components/user/index.js'
I've been reading and it may be a windows problem since case sensitive is not enabled in the folder paths. I also tried with git config --global core.ignorecase false
but it keeps failing.
This problem is faced with all case-insensitive file systems, i.e Windows 10(NTFS) and macOS(APFS).
Does anyone also see this problem?
Upvotes: 57
Views: 55059
Reputation: 493
My solution to this issue (on Windows) was to:
After this my repo was showing as up to date with nothing to commit.
Upvotes: 13
Reputation: 14008
The process of changing your entire file system on macOS is very time-consuming and risky. One can utilize Disk Images as explained here to create virtual containers with specific case-sensitive (i.e., "Journaled") file systems:
If one likes to use terminal:
hdiutil create -type SPARSE -fs 'Case-sensitive APFS' -volname <volumeName> <fileName>
.hdiutil attach <fileName>.sparseimage
command, mounts the image into /Volumes/<volumeName>
which you can cd
into.diskutil unmount /Volumes/<volumeName>
.You may find more info here.
Upvotes: 6
Reputation: 1423
john.jpg
and JOHN.jpg
as two different files and this is allowed.john.jpg
and JOHN.jpg
as one and the same file which is not allowed.'components/User/index.js'
'components/user/index.js'
The problem here is that User
and user
are not allowed to co-exist at the same time inside the components
directory on a case-insensitive filesystem (which is NTFS if you're using Windows 10).
If you have recently cloned the repo and have not done any work on it yet, I recommend that you start over. So remove the clone, then enable case-sensitivity for the directory you intend to clone your repo in, and then clone it anew. The benefit of doing this ahead of the cloning process is that all directories that are created as part of the cloning process by git will be case-sensitive and git will no longer give this warning. Plus, it enables you to clean up the mess.
C:\Users\Juan\Desktop
. You don't have to cd
to this directory to do the next step, just know what your target directory is.fsutil.exe file SetCaseSensitiveInfo "C:\Users\Juan\Desktop" enable
https://github.com/torvalds/linux.git
. Command: git clone https://github.com/torvalds/linux.git
git rm
and to move or copy, use git mv
.fsutil.exe file SetCaseSensitiveInfo "C:\Users\Juan\Desktop" disable
Now you can go back to working on the project.
Source: Windows Central
On macOS, you will have to reformat volume as case-insensitive/sensitive or make a new volume altogether. Details
You probably ran into this problem because you cloned a repo that was created on a computer that runs Linux or Mac, perhaps it was created by someone else and not you personally. The lesson here is to always be consistent with the way you name things, and this applies to everyone involved in a project. This is one example of what can happen otherwise.
Upvotes: 53
Reputation: 14992
Use Windows 10's ability to enable case sensitivity on a per-directory basis.
Also, Windows Subsystem for Linux let's you mount Windows folders as case sensitive.
For more information:
How to Enable Case Sensitive File and Folder Names on Windows 10
Per-directory case sensitivity and WSL | Windows Command Line
Upvotes: 3