{"thread":{"id":"54030","subject":"Re: Files 'Test.txt' and 'test.txt' are different in Git database, but are the same on Windows file system issue","startedAt":"2020-08-12T19:59:10Z","lastAt":"2020-08-12T23:03:11Z","messageCount":2,"participants":["Viktor Hozhyi","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"403501","messageId":"CAAkwws_Y56QF8XnsBgG+HSF_mRpetJGh6TnTbjCgdwZ88kov=A@mail.gmail.com","threadId":"54030","inReplyTo":"27608194-0D85-4D71-8D88-C1278D8DA173@hxcore.ol","subject":"Re: Files 'Test.txt' and 'test.txt' are different in Git database, but are the same on Windows file system issue","fromName":"Viktor Hozhyi","fromEmail":"viktor.hozhyi@gmail.com","sentAt":"2020-08-12T19:58:55Z","receivedAt":"2020-08-12T19:59:10Z","isPatch":false,"sender":{"key":"viktor.hozhyi@gmail.com","avatar":null},"body":"On Wed, Aug 12, 2020 at 10:56 PM Viktor <viktor.hozhyi@gmail.com> wrote:\n>\n> Hi,\n>\n>\n>\n> I’m not sure whether this behavior is on Windows only, so it’s up to you guys.\n>\n>\n>\n> Repro steps:\n>\n> 1.         Having branch (let say) develop with empty working tree and empty repository – create 2 more branches (‘foo’ and ‘bar’)\n>\n> 2.         Commit file ‘Test.txt’ with content ‘Test’ to ‘foo’ branch\n>\n> 3.         Switch to ‘bar’  branch and commit file ‘test.txt’ with content ‘test’ (pay attention lower-case)\n>\n> 4.         Merge ‘foo’ to develop\n>\n> 5.         Merge ‘bar’ to develop\n>\n> After it when you switch to develop – you always will have ‘local changes’. You can perform stash, hard reset, commit – you always will have local changes (and many following errors on other git operations due to local changes).\n>\n> Reason – we have different files in Git DB (‘Test.txt’ and ‘test.txt’), but when git restores them onto Windows file system – it just will rewrite 1 file with another, because for Windows file system – it is 2 equal names.\n>\n>\n>\n> Best regards,\n>\n> Viktor Hozhyi\n>\n> Skype: vitia444\n>\n> Phone (Telegram): +38 067 276 29 85\n>\n>\n\n\n\n-- \nBest regards,\nViktor Hozhyi\nSkype: vitia444\nPhone (Telegram): +38 067 276 29 85\n"},{"id":"403516","messageId":"20200812230231.GH8085@camp.crustytoothpaste.net","threadId":"54030","inReplyTo":"CAAkwws_Y56QF8XnsBgG+HSF_mRpetJGh6TnTbjCgdwZ88kov=A@mail.gmail.com","subject":"Re: Files 'Test.txt' and 'test.txt' are different in Git database, but are the same on Windows file system issue","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-08-12T23:02:31Z","receivedAt":"2020-08-12T23:03:11Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-08-12 at 19:58:55, Viktor Hozhyi wrote:\n> On Wed, Aug 12, 2020 at 10:56 PM Viktor <viktor.hozhyi@gmail.com> wrote:\n> >\n> > Hi,\n> >\n> >\n> >\n> > I’m not sure whether this behavior is on Windows only, so it’s up to you guys.\n\nThis behavior happens on any case-insensitive file system.  That means\non Windows when the directory is not marked case-sensitive, on macOS if\nthe file system is case-insensitive, and also in some other scenarios\n(e.g., case-insensitive JFS on Linux).\n\nBoth Windows 10 and macOS are capable of using case-sensitive file\nsystems or directories, so this is not exclusive to any one operating\nsystem.\n\n> > Repro steps:\n> >\n> > 1.         Having branch (let say) develop with empty working tree and empty repository – create 2 more branches (‘foo’ and ‘bar’)\n> >\n> > 2.         Commit file ‘Test.txt’ with content ‘Test’ to ‘foo’ branch\n> >\n> > 3.         Switch to ‘bar’  branch and commit file ‘test.txt’ with content ‘test’ (pay attention lower-case)\n> >\n> > 4.         Merge ‘foo’ to develop\n> >\n> > 5.         Merge ‘bar’ to develop\n> >\n> > After it when you switch to develop – you always will have ‘local changes’. You can perform stash, hard reset, commit – you always will have local changes (and many following errors on other git operations due to local changes).\n> >\n> > Reason – we have different files in Git DB (‘Test.txt’ and ‘test.txt’), but when git restores them onto Windows file system – it just will rewrite 1 file with another, because for Windows file system – it is 2 equal names.\n\nGit was designed for Unix systems where files are case sensitive.  This\nis the only behavior that produces correct results for all languages and\nlocales; it's impossible to correctly do locale-insensitive case\nfolding.  That Git is case sensitive is very much by design.\n\nIf you're seeing this problem, you can do something like this:\n\n  git mv --cached Test.txt test.txt\n\nFor a directory, you'd need to do this:\n\n  git mv Test temp\n  git mv temp test\n\nThat will move Test.txt into test.txt, which will solve your problem by\ncreating exactly one file.  If you prefer, you can do it the other way\nas well.\n\nThat's the only possible solution if you're using a case-insensitive\nfile system; the other choice is to use the Windows 10 tools to make the\nrepository and its child directories case sensitive.\n-- \nbrian m. carlson: Houston, Texas, US\n"}]}