The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,841 other followers

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

One Response to “case insensitive files systems and git – Lesson Learned – I Can’t Get My Git Repo Clean! | DrupalEasy”

  1. kamila rodrigo said

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: