case insensitive files systems and git – Lesson Learned – I Can’t Get My Git Repo Clean! | DrupalEasy
Posted by jpluimers on 2016/07/06
via: Lesson Learned – I Can’t Get My Git Repo Clean! | DrupalEasy
One file kept getting added to the git modified list: service/src/main/MySOAPdefinition.pas.
It was part of a repository that had been migrated from SVN (more on that in a future blog post) and along the way been renamed in directory service/src/main from MySOAPdefinition.pas to MySoapDefinition.pas. SVN (and TortoiseSVN) don’t object to this. But git does.
You’d see this on the command-line:
>git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
modified: service/src/main/MySOAPdefinition.pas
no changes added to commit (use "git add" and/or "git commit -a")
>git add service\src\main\MySoapDefinition.pas
>git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
modified: service/src/main/MySOAPdefinition.pas
no changes added to commit (use "git add" and/or "git commit -a")
Basically the add would do nothing.
On Windows, this is how to get around this:
>git mv service\src\main\MySOAPdefinition.pas service\src\main\MySoapDefinition.pas
>git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes to be committed:
(use "git reset HEAD ..." to unstage)
renamed: service/src/main/MySOAPdefinition.pas -> service/src/main/MySoapDefinition.pas
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
But on unices, you need to --force this otherwise you will get an error:
$ git mv MySOAPdefinition.pas MySoapDefinition.pas
fatal: destination exists, source=service/src/main/MySOAPdefinition.pas, destination=service/src/main/MySoapDefinition.pas
$ git mv MySOAPdefinition.pas MySoapDefinition.pas --force
Now it worked.
–jeroen






kamila rodrigo said
for removing duplicate files from your computer you can use “duplicatefilesdeleter”