In the first commitment of my partial called _Electronics
it was written beginning with a capital letters, then I changed it to _electronics
.
Git under cygwin ignored the case after commiting the new name, so I changed the name by hand in the target repo.
Now it sometimes changes the commited _electronics
partial to _Electronics
.
What have I done wrong?
Git is case-sensitive and your filesystem may not be - Weird folder merging on Windows - Scott Hanselman's Blog.
Git is a unix based code. its is case sensitive so it will allow you to have the same name in different cases, and as you except windows will not be tolerated for this. There is nothing you can do about it beside renaming your folders.
The organization name. The name is not case sensitive.
It is going to depend on the core.ignorecase
configuration value, which is set to false in case-sensitive filesystems and true in msysgit on Windows.
core.ignorecase
If true, this option enables various workarounds to enable git to work better on filesystems that are not case sensitive, like FAT. For example, if a directory listing finds "makefile" when git expects "Makefile", git will assume it is really the same file, and continue to remember it as "Makefile".
The default is false, except git-clone(1) or git-init(1) will probe and set core.ignorecase true if appropriate when the repository is created.
More detail in this reply to Changing capitalization of filenames in Git.
It will be seen as 2 different things but will cause you issues on a non-case-sensitive system. If this is the case, ensure you are tab-completing any paths or file names. Further, to change the name of something in just the case, do this:
mv file.txt temp.txt git add -A git commit -m "renaming..." mv temp.txt File.txt git add -A git commit --amend -m "Renamed file.txt to File.txt"
This is an explicit way of making changes committing them, then collapsing the commits. A shorter way to do it is to manipulate the index and working folder all in one:
git mv file.txt temp.txt git mv temp.txt File.txt git commit -m "Renamed file.txt to File.txt"
This is related to adjusting directory names as well: git mv and only change case of directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With