首页 > 解决方案 > Intellij is merging two folders with the same name

问题描述

So i have two folders named "Folder1" and "folder1" in my git repository. But when i pull them onto IntelliJ For some reason it is merging both the folders into one named "IntelliJ".

For example:

if Folder1 has a file File1
and folder1 has a file File2
it creates a single Folder1 with both File1 and File2 in it.

I tried looking for the solution everywhere on the internet but it seems no one else ever encountered this problem before.

I am looking for a way so that this doesn't happen automatically.

Thanks in Advance. :)

标签: windowsgitmacos

解决方案


您的文件系统不区分大小写。

您遇到的问题是git(它允许有两个名称不同,仅大写/小写一个一个并排),当尝试创建两个文件夹Folder1folder1在您的系统中并写入这些文件夹时,最终会写入同一个文件夹。

这个问题应该出现在 MacOS 和 Windows 工作站上。

从技术上讲,这个问题与文件系统(而不是操作系统)有关,因此例如通过 linux 站的网络共享或拇指驱动器上的 FAT32 文件系统访问 NTFS 文件系统会触发类似的问题。


稳定的“修复”是确保这种情况(仅字母大小写不同的文件或文件夹)不会在您的存储库中发生。

检查创建这两个文件夹的原因(可能是开发人员无意中从另一个不区分大小写的系统中提交了文件夹名称的“错误”版本......),并查看正确的修复方法是:

  • 将两个文件夹合并在一起,
  • 或为其中一个文件夹找到更独特的名称。

推荐阅读