# issue unable to commit file and folder name to upper lower case

3 messages from 2023-11-07 to 2023-11-08. Participants: chengpu lee, Torsten Bögershausen, Junio C Hamano.
Thread: https://gitlist.dev/t/60485

## chengpu lee, 2023-11-07 11:28

Subject: issue unable to commit file and folder name to upper lower case
Message-ID: <CAHv3AeCOoEXxpNh=gzjNcKbVyZFaYZ5BzSf3FGL1=pdheNebZw@mail.gmail.com>
URL: https://gitlist.dev/e/CAHv3AeCOoEXxpNh%3DgzjNcKbVyZFaYZ5BzSf3FGL1%3DpdheNebZw%40mail.gmail.com

```
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
$ mkdir abc

$ echo "">abc/.keep

$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        abc/

$ mv abc Abc

$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Abc/                                                      # rename
to Abc/ successfully

$ git commit -m "commit Abc/"                                     # commit

$ mv Abc abc

$ git status
On branch master
nothing to commit, working tree clean                             # cannot
rename again

$ git diff
>""

$ git add .

$ git commit -m "Cannot rename from Abc/ to abc/"
On branch master
nothing to commit, working tree clean                             # cannot
commit to right, keep old file name / folder name


What did you expect to happen? (Expected behavior)
It should be correct to new name although just change upper/lower case,
because other commiter can pull it from repo or improve reading clarity.

What happened instead? (Actual behavior)
can commit file/folder but cannot fix upper/lower case.

What's different between what you expected and what actually happened?
git unable to faithfully represent file/folder upper/lower case changes.

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.40.0.windows.1
cpu: x86_64
built from commit: 1d90ca2906dd4b7ddaf0669a13c173ec579d794a
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19045
compiler info: gnuc: 12.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]


Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
$ mkdir abc

$ echo "">abc/.keep

$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        abc/

$ mv abc Abc

$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Abc/                                                      # rename to Abc/ successfully

$ git commit -m "commit Abc/"                                     # commit

$ mv Abc abc

$ git status
On branch master
nothing to commit, working tree clean                             # cannot rename again

$ git diff
>""

$ git add .

$ git commit -m "Cannot rename from Abc/ to abc/"
On branch master
nothing to commit, working tree clean                             # cannot commit to right, keep old file name / folder name


What did you expect to happen? (Expected behavior)
It should be correct to new name although just change upper/lower case, because other commiter can pull it from repo or improve reading clarity.

What happened instead? (Actual behavior)
can commit file/folder but cannot fix upper/lower case.

What's different between what you expected and what actually happened?
git unable to faithfully represent file/folder upper/lower case changes.

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.40.0.windows.1
cpu: x86_64
built from commit: 1d90ca2906dd4b7ddaf0669a13c173ec579d794a
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19045 
compiler info: gnuc: 12.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]

```

## Torsten Bögershausen, 2023-11-07 17:35

Subject: Re: issue unable to commit file and folder name to upper lower case
Message-ID: <20231107173557.GA29083@tb-raspi4>
URL: https://gitlist.dev/e/20231107173557.GA29083%40tb-raspi4
In-Reply-To: <CAHv3AeCOoEXxpNh=gzjNcKbVyZFaYZ5BzSf3FGL1=pdheNebZw@mail.gmail.com>

```
On Tue, Nov 07, 2023 at 07:28:14PM +0800, chengpu lee wrote:
> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
>
> What did you do before the bug happened? (Steps to reproduce your issue)
> $ mkdir abc
>
> $ echo "">abc/.keep
>
> $ git status
> On branch master
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
>         abc/
>
> $ mv abc Abc
>
> $ git status
> On branch master
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
>         Abc/                                                      # rename
> to Abc/ successfully
>
> $ git commit -m "commit Abc/"                                     # commit
>
> $ mv Abc abc
>
> $ git status
> On branch master
> nothing to commit, working tree clean                             # cannot
> rename again
>
> $ git diff
> >""
>
> $ git add .
>
> $ git commit -m "Cannot rename from Abc/ to abc/"
> On branch master
> nothing to commit, working tree clean                             # cannot
> commit to right, keep old file name / folder name
>
>
> What did you expect to happen? (Expected behavior)
> It should be correct to new name although just change upper/lower case,
> because other commiter can pull it from repo or improve reading clarity.
>
> What happened instead? (Actual behavior)
> can commit file/folder but cannot fix upper/lower case.
>
> What's different between what you expected and what actually happened?
> git unable to faithfully represent file/folder upper/lower case changes.
>

Yes, that is a restriction in Git, call it a bug, call it a missing feature.
Unless someone fixes it, the recommendation is still to use a workaround:

tb@pc:/tmp/ttt> git mv Abc tmp
tb@pc:/tmp/ttt> git mv tmp abc
tb@pc:/tmp/ttt> git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        renamed:    Abc/.keep -> abc/.keep

tb@pc:/tmp/ttt>

```

## Junio C Hamano, 2023-11-08 01:48

Subject: Re: issue unable to commit file and folder name to upper lower case
Message-ID: <xmqqleb9816p.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqleb9816p.fsf%40gitster.g
In-Reply-To: <20231107173557.GA29083@tb-raspi4>

```
Torsten Bögershausen <tboegi@web.de> writes:

> Yes, that is a restriction in Git, call it a bug, call it a missing feature.
> Unless someone fixes it, the recommendation is still to use a workaround:
>
> tb@pc:/tmp/ttt> git mv Abc tmp
> tb@pc:/tmp/ttt> git mv tmp abc
> tb@pc:/tmp/ttt> git status
> On branch master
> Changes to be committed:
>   (use "git restore --staged <file>..." to unstage)
>         renamed:    Abc/.keep -> abc/.keep
>
> tb@pc:/tmp/ttt>

Correct and very helpful suggestion.  Or get a better filesystem ;-)

Thanks.


```
