Uper/lower Case files extension
See original GitHub issueDescription
As HTML is Case sensitive for images names, if I change a pic’s extension from JPG to jpg, GitHub desktop app doesn’t seems to update the difference and do not ask for git push update. PS: I would like so much to work for you. If you have any job to give to me, do not hesitate I would be fully committed
Version
GitHub Desktop version: [0.8.0.0]
OS version: [windows 10 x64]
Steps to Reproduce
- [Change extension on desktop explorer from JPG to jpg]
- [Open Git Desktop]
- [Doesn’t seems to update files extension in order to push it to server]
Expected behavior: [Propose to commit to master]
Actual behavior: [No change shown]
Reproduces how often: [it reproduce 100% of time definitely]
Logs
Additional Information
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Convention for file extensions: uppercase or lowercase
Is there a convention for the case of the file extension in Windows, i.e. all uppercase vs. all lowercase? If there is, what...
Read more >4 Ways to Change File Extension to Uppercase/Lowercase in ...
Option 1: Change File Extension to .bak and Change Again to Desired Extension ... Within Windows Explorer, right click on the file name,...
Read more >File Extensions Capitalized - Microsoft Community
Hello, I am experiencing an issue where my files are being saved with the extension in all in uppercase and it is quite...
Read more >Change Case
The set of advanced methods to change case of text, delivered as convenient extension for browser Google Chrome.
Read more >Saving or Using a file name that have the extension in ...
Recently I got a error fix that a user tried to upload a file with the name some_name.PNG (focus on the extension name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@GregoireSailland thanks for the extra details.
This behaviour is driven from Git’s
core.ignorecase
config value:A quick test of this indicates Git 2.14.1 will set this to true within the repository (rather than globally):
So while you could set
core.ignorecase
to false, there’s also known limitations that Git is probing for. From the Wikipedia article about filesystems:macOS also suffers from the same limitation, but it occurs in a slightly different way:
Anyway, hope that gives some insight. You _could_try and set
core.ignorecase=false
to see if it works, but I think you’re gonna have a bad time elsewhere. For example, thisREADME.md
file was already tracked by Git, but renaming it toREADME.MD
meant Git then considers it an untracked file:👋 I’m crashing your issues since I tweeted about something similar.
This is the correct behavior. This is because some tools do stupid things and will accidentally rewrite a file with a different filename (differing in case only). Some programs will do things like write to a lock file and then move it into place. eg, when editing a file named
FOO.txt
, they will createfoo.txt.lock
and then move that tofoo.txt
. They make big assumptions about their ability to do this in the case sensitivity of the underlying filesystem.This is a bummer, but it would be terrible for a version control system to flip-flop the case of a filename based on a broken tool.
Similarly, GitHub Desktop should not detect that a filename’s case has changed (when running on a case insensitive filesystem).
Yep, this is true. This is examined and detected when you create a repository (either via
git init
orgit clone
). You could have different filesystems mounted with different case sensitivity. For example: you could have a FAT32 USB key on your Linux box that otherwise uses ext3 with case sensitive filesystems. So this is done on a per-repository basis.(Having a git repository span multiple filesystems with different case sensitivity characteristics would not be supported.)
To be very clear: this is a cache of the underlying characteristics of the filesystem. Detecting whether a filesystem is case sensitive or not is slow - it requires writing a file and reading it back in (with a different filename). Git does not want to do this detection every time you run a Git command, so it detects it when the repository is created and caches it.
This is not an option that you can change.
If your filesystem is case insensitive, then Git will behave this way. If you want to perform a case-changing rename (change a filename’s case only) then you need to explicitly tell Git to track the new filename: