0

I am using git to sync a repo on GitLab.

I have two files:

a.jade and A.jade

However, when I hit git pull, I only got a.jade. It seems there's something wrong if there are two files with the same letters but one in lowercase and another in uppercase.

What should I do?

I am using macOS 10.14.6

Daemon Painter
  • 3,208
  • 3
  • 29
  • 44
AGamePlayer
  • 7,404
  • 19
  • 62
  • 119

2 Answers2

0

The default file system on macOS is case-retaining but case-insensitive: that is, if you create a file named, e.g., README, and then ask the OS to open a file named readme, it will open the file named README instead.

What this means is that the system itself forbids the existence of both a.jade and A.jade: these two names represent a single file, not two separate files. Git cannot overcome this system limitation, so it can only extract one of those two files. To understand this properly, see this answer to a related question.

If you have access to a Linux system, make a clone of the GitLab repository there, rename one of the two files (and make any other necessary changes), commit that, and push the commit. The new commit can then be extracted on your macOS system. Alternatively, see the above linked answer for a method for creating a case-sensitive disk image on your macOS system.

torek
  • 448,244
  • 59
  • 642
  • 775
-2
  • Check if A.jade is not listed in .gitignore file.
  • Try running git fetch --all command to get all updated from origin. Beforehand, you may want to save your local updates using git stash save command.
initanmol
  • 340
  • 1
  • 4
  • Hello, and welcome to SO. Your answer is an attempt to answer, but not relevant here. UNIX based OS don't differentiate between lower and upper cases in file names. Certainly, [Mac OS is case insensitive](https://www.google.com/search?q=mac+os+filename+case+sensitive&rlz=1C1GCEU_itIT889IT889&oq=mac+os+filename+case+sensitive&aqs=chrome..69i57j0l2.12569j0j7&sourceid=chrome&ie=UTF-8) – Daemon Painter Jul 22 '20 at 11:56
  • @DaemonPainter Thank you pointing it out. I just started using MacOS and didn't fall into this case. – initanmol Jul 22 '20 at 13:20
  • @AGamePlayer Try this and see if it fixes your issue - http://blog.nickburwell.com/blog/2008/11/mac-os-x-terminal-case-insensitive-auto/ – initanmol Jul 22 '20 at 13:20