Search code examples
gitmacosgithubbitbucketcase-sensitive

git: remove files of the remote repository that are been deleted in the local repository


Some files exists in the remote repository (bitbucket). However those files does not exist in the local repository anymore.

I guess it is related with the following command:

git config core.ignorecase false

I executed that command after realising the files were correct in my computer (OSX) but wrong in the Git repository (they were lower case in the local repository but upper case in the remote repository). Then I executed:

git add . && git commit -m "comment"
git push origin master

Unfortunately the upper case files of the repository have not change to lower case. Instead, the repository has kept both the lower and upper case files repeated.

I have executed commands like:

git diff master origin (it does not show anything, I guess because it does not detect any change).
git commit -a (no effect)
git add -u (no effect)

Solution

  • This is what I did to solve the issue:

    I downloaded several Git GUIs. The GitUp GUI showed the duplicate files I don't know why:

    GitUp screenshot

    I realised only two folders had duplicates. So the solution has been:

    • Move both folders to the Desktop (I did it with Finder on OSX; if you use Windows you could use its File Explorer or any other GUI).
    • Add & Commit with Git
    • Move both folders to their original location
    • Add & Commit with Git again