Reputation: 624
I had duplicate directories in Github (differing in case). It seems they are both tracked to a single directory in my local. How do I properly delete one of the directories without affecting my local?
General steps I took (IIRC):
Upvotes: 4
Views: 2852
Reputation: 83527
TLDR: Don't set core.ignorecase=false
. This is opposite of what your operating system actually does and causes git to behave unexpectedly.
I think there is some confusion here about file names, Git, and GitHub.
The file system from your operating system: Linux and Mac use case-sensitive file names. Windows file names are case-insensitive.
Git: Git has a configuration called core.ignorecase
that you can set. This is used to inform Git about the behavior of your operating system. If you set it opposite of what your operating system actually does, then Git will behave in unexpected ways. Note that this doesn't modify the case sensitivity of the underlying file system.
Git Hub: This is a web service that is built on top of Git. For this discussion, it is not really a factor as case sensitivity of file names is not managed at this level.
Additionally, Git does only tracks file contents. It does not track directories directly. The only way to remove a directory from Git's version control is to remove the files from that directory.
I know this doesn't directly answer your question, but I hope it clarifies how these three pieces contribute to the issue.
Upvotes: 3