threads / discuss / 44830

Git filesystem case-insensitive to case-sensitive system broken

Subject: Git filesystem case-insensitive to case-sensitive system broken

## tl;dr

2 messages between Jan 6, 2017 and Jan 7, 2017.

replies: 1people: 2as markdown or json

Steven Robertson· Jan 6, 2017, 21:56 UTC · lore
Hello,

I was doing development on a linux box on AWS, when we found a code bug that had me switching to running the code on a Mac instead. We discovered that we had accidentally named two files the same when looked at case-insensitively, which made git commands afterwards display the wrong thing. It looked like this (ignoring some things that aren't relevant):

$ git status
   modified:   tests/test_system/show_19_L.txt
no changes added to commit (use "git add" and/or "git commit -a")
$ git checkout tests/test_system/show_19_L.txt
$ git status
   modified:   tests/test_system/show_19_l.txt
no changes added to commit (use "git add" and/or "git commit -a")
$ git checkout tests/test_system/show_19_l.txt
$ git status
   modified:   tests/test_system/show_19_L.txt
no changes added to commit (use "git add" and/or "git commit -a")
$ diff tests/test_system/show_19_L.txt tests/test_system/show_19_l.txt
$

Those two files are different in our repo, and as such git thinks that we modified one of them when we try and pull it down from github again.

Thanks for looking at this! -- Steven

Torsten Bögershausen· Jan 7, 2017, 13:48 UTC · re: Steven Robertson · lore

Re: Git filesystem case-insensitive to case-sensitive system broken

On Fri, Jan 06, 2017 at 01:56:36PM -0800, Steven Robertson wrote:
Show 49 quoted lines
> Hello,
> 
> I was doing development on a linux box on AWS, when we found a code
> bug that had me switching to running the code on a Mac instead. We
> discovered that we had accidentally named two files the same when
> looked at case-insensitively, which made git commands afterwards
> display the wrong thing. It looked like this (ignoring some things
> that aren't relevant):
> 
> $ git status
> 
> 
>    modified:   tests/test_system/show_19_L.txt
> 
> 
> no changes added to commit (use "git add" and/or "git commit -a")
> 
> $ git checkout tests/test_system/show_19_L.txt
> 
> $ git status
> 
> 
>    modified:   tests/test_system/show_19_l.txt
> 
> 
> no changes added to commit (use "git add" and/or "git commit -a")
> 
> $ git checkout tests/test_system/show_19_l.txt
> 
> $ git status
> 
> 
>    modified:   tests/test_system/show_19_L.txt
> 
> 
> no changes added to commit (use "git add" and/or "git commit -a")
> 
> $ diff tests/test_system/show_19_L.txt tests/test_system/show_19_l.txt
> 
> $
> 
> 
> Those two files are different in our repo, and as such git thinks that
> we modified one of them when we try and pull it down from github
> again.
> 
> 
> Thanks for looking at this!
> -- Steven

I assume that you are on Mac OS ? This is what I would have done:

- find the twin of your file:
$  git ls-files | grep -i tests/test_system/show_19_L.txt
- Let's assume it is the little brother:
  "tests/test_system/show_19_l.txt"
$  git mv tests/test_system/show_19_l.txt tests/test_system/show_19_l2.txt
- Check out the original:
$ git checkout tests/test_system/show_19_L.txt
- check:
$ git status

← back to recent threads