git on mac osx: how to push filename cases to origin?

I have changed the case of some directories in my git repository.
Then I pushed them and noticed the cases where not updated.

Then I found this question:
git mv and only change case of directory

  • How do you specify git URLs with spaces on Windows under cygwin?
  • Change case of a file on Windows?
  • Find commits that modify file names matching a pattern in a GIT repository
  • Git error: Malformed input or input contains unmappable chacraters
  • how do I clone files with colons in the filename
  • Git diff fails on file with underscore in path
  • I have followed the advice to use:

    git add -A
    git commit --amend -m 'updated cases'
    git push origin

    but instead of success the git server is returning:

     ! [rejected]        master -> master (non-fast-forward)
    error: failed to push some refs to ''
    To prevent you from losing history, non-fast-forward updates were rejected
    Merge the remote changes (e.g. 'git pull') before pushing again.  See the
    'Note about fast-forwards' section of 'git push --help' for details.

    What can I now do to update the cases without breaking more in my git repo?



    PS: To avoid this issue in future you can use:

    git config core.ignorecase false

  • git-subtree pull complications
  • git how to switch branches without committing your changes
  • Window Git $ git config --global http.proxy warning: http.proxy has multiple values
  • How do I synchronise two remote Git repositories?
  • automated push to a github repo with travis
  • What git setup and commands can help managing private content on a public Github?
  • One Solution collect form web for “git on mac osx: how to push filename cases to origin?”

    You need:

    git push --force

    since you have rewritten the last SHA1 with your –amend, after using git mv.

    It won’t break your repo unless you have other collaborators having already pulled from your previous commit as explained in “How do I push amended commit to the remote git repo?”.
    (in that case, you would need other options for publishing your fixed commit)

    On OsX, this answer does suggest (to avoid this issue):

    git config --unset-all core.ignorecase
    git config --system core.ignorecase false 

    The OP kyogron reports having found a working solution:

    • Create a new branch and checkout this new branch.
    • Then delete the .DS_Store file in the directory of the corrupted directory and rename it to new name.
    • Then remove wrong directory in the repository (you can view them with git ls-files) and commit this change.
    • Again remove the .DS_Store and now rename the directory to the lower case name you want with git mv
    Git Baby is a git and github fan, let's start git clone.