I am working on a Mac. Something happened that changed the capitalization of my files (and I started modifying them before I noticed), but git doesn't see any difference. Looking at these problems ( I change the capitalization of a directory, and the git, it seems, not gaining it , Change capitalization of file names in the Git , How to change only file names with the names in the Git? , Https://ocroquette.wordpress.com/2014/07 / 08 / git-capitalization-of-file-names-and-name-conflicts / ) I tried to install git config core.ignorecase false, but git still does not see the difference in names.
In the end, I decided by deleting everything and checking again, I wonder if there was a cleaner solution.
Here is a simplification of my session:
$ mkdir test && cd test && git init && git config core.ignorecase false
Initialized empty Git repository in /Users/myName/Work/test/.git/
$ git --version
git version 1.8.5.2 (Apple Git-48)
$ git config core.ignorecase
false
$ touch UPPERCASE.txt lowercase.txt CamelCase.txt
$ git add * && git commit -a -m "Original repository"
[master (root-commit) 3eeae11] Original repository
3 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 CamelCase.txt
create mode 100644 UPPERCASE.txt
create mode 100644 lowercase.txt
$ for f in *.txt;do newname=$(echo $f|tr 'A-Z' 'a-z');mv $f $newname;done && ls .
camelcase.txt lowercase.txt uppercase.txt
$ git diff
$ for f in *.txt;do echo "I am modifiying the file too" >> $f; done
$ git commit -am "file modified in content and filename"
[master 6f868b8] file modified in content and filename
3 files changed, 3 insertions(+)
$ git diff
$ git config --get core.ignorecase
false
$ git reset --hard HEAD && ls
HEAD is now at 6f868b8 file modified in content and filename
camelcase.txt lowercase.txt uppercase.txt
$ git checkout master && ls
Already on 'master'
camelcase.txt lowercase.txt uppercase.txt
$ rm *.txt && git reset --hard HEAD && ls
HEAD is now at 6f868b8 file modified in content and filename
CamelCase.txt UPPERCASE.txt lowercase.txt
source
share