-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git not ignoring case in filenames that are checked out from another commit #2502
Comments
This is the expected behavior, kind of. Git can not make any decision, which of those 3 is the "right one". |
I concur with @tboegi: there is little Git can do in this case. Maybe warn, or error out, because the two files cannot be represented by two separate files on a case-insensitive filesystem. |
@eggonzal are you feeling up to providing an awesome patch to implement that warning/error message? If so, first upgrade from your (vulnerable) version to v2.25.0 and see whether such a message has already been implemented. If not:
|
Is not possible for Git to behave as the OS would behave? For example if I manually want to reproduce that conflicting state by copying and pasting files or redirecting an input to the file with the case letters changed, I'm not able to fool Git, but if I checkout files from a different revision into the working index, it gets conflicted (isn't it possible to fix it at this stage?). I guess I could look in advance for the issues and programmatically fix them but still I'm not sure how I can tell which file was in place and which file is new. Ideally Git would override the existing file with the new one or at least that would be what I want to do. |
I think the problem here is that you switch from one revision that has the file to another revision that has the file with a different casing. So if you When I looked around for a way to find the on-disk casing for any given file, I found only solutions that would put a serious performance dent into things. So I guess you would need to do this on the index, probably using the |
Can you elaborate more on the Thanks |
No, Just get the Git for Windows SDK, call |
For those who are interested to work on Git, there is a check when commit b878579 |
Setup
defaults?
to the issue you're seeing?
My config is set to ignore case as the OS does.
Details
CMD, gitpython, gitbash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Expected git to ignore the file name upper and lower cases, as it does when you try to add a file with the cases modified with git add or by manually changing the file name in the OS.
Git thinks that there are 2 different files but the OS only sees one.
In this scenario git says that there is a New file named
myfile.txt
and a modified file namedMyFile.txt
. So it causes some conflicts with a GitPython application that I use to automate the code tracking using git.I'm not sure if that is the only possible way to trigger this behavior but I'm sure that is not being consistent with how it handles a scenario like:
In this scenario git ignores the upper and lower case differences as expected.
URL to that repository to help us with testing?
Any repo
The text was updated successfully, but these errors were encountered: