git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Re: Files 'Test.txt' and 'test.txt' are different in Git database, but are the same on Windows file system issue
       [not found] ` <27608194-0D85-4D71-8D88-C1278D8DA173@hxcore.ol>
@ 2020-08-12 19:58   ` Viktor Hozhyi
  2020-08-12 23:02     ` brian m. carlson
  0 siblings, 1 reply; 2+ messages in thread
From: Viktor Hozhyi @ 2020-08-12 19:58 UTC (permalink / raw)
  To: git@vger.kernel.org

On Wed, Aug 12, 2020 at 10:56 PM Viktor <viktor.hozhyi@gmail.com> wrote:
>
> Hi,
>
>
>
> I’m not sure whether this behavior is on Windows only, so it’s up to you guys.
>
>
>
> Repro steps:
>
> 1.         Having branch (let say) develop with empty working tree and empty repository – create 2 more branches (‘foo’ and ‘bar’)
>
> 2.         Commit file ‘Test.txt’ with content ‘Test’ to ‘foo’ branch
>
> 3.         Switch to ‘bar’  branch and commit file ‘test.txt’ with content ‘test’ (pay attention lower-case)
>
> 4.         Merge ‘foo’ to develop
>
> 5.         Merge ‘bar’ to develop
>
> 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).
>
> 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.
>
>
>
> Best regards,
>
> Viktor Hozhyi
>
> Skype: vitia444
>
> Phone (Telegram): +38 067 276 29 85
>
>



-- 
Best regards,
Viktor Hozhyi
Skype: vitia444
Phone (Telegram): +38 067 276 29 85

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Files 'Test.txt' and 'test.txt' are different in Git database, but are the same on Windows file system issue
  2020-08-12 19:58   ` Files 'Test.txt' and 'test.txt' are different in Git database, but are the same on Windows file system issue Viktor Hozhyi
@ 2020-08-12 23:02     ` brian m. carlson
  0 siblings, 0 replies; 2+ messages in thread
From: brian m. carlson @ 2020-08-12 23:02 UTC (permalink / raw)
  To: Viktor Hozhyi; +Cc: git@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 2501 bytes --]

On 2020-08-12 at 19:58:55, Viktor Hozhyi wrote:
> On Wed, Aug 12, 2020 at 10:56 PM Viktor <viktor.hozhyi@gmail.com> wrote:
> >
> > Hi,
> >
> >
> >
> > I’m not sure whether this behavior is on Windows only, so it’s up to you guys.

This behavior happens on any case-insensitive file system.  That means
on Windows when the directory is not marked case-sensitive, on macOS if
the file system is case-insensitive, and also in some other scenarios
(e.g., case-insensitive JFS on Linux).

Both Windows 10 and macOS are capable of using case-sensitive file
systems or directories, so this is not exclusive to any one operating
system.

> > Repro steps:
> >
> > 1.         Having branch (let say) develop with empty working tree and empty repository – create 2 more branches (‘foo’ and ‘bar’)
> >
> > 2.         Commit file ‘Test.txt’ with content ‘Test’ to ‘foo’ branch
> >
> > 3.         Switch to ‘bar’  branch and commit file ‘test.txt’ with content ‘test’ (pay attention lower-case)
> >
> > 4.         Merge ‘foo’ to develop
> >
> > 5.         Merge ‘bar’ to develop
> >
> > 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).
> >
> > 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.

Git was designed for Unix systems where files are case sensitive.  This
is the only behavior that produces correct results for all languages and
locales; it's impossible to correctly do locale-insensitive case
folding.  That Git is case sensitive is very much by design.

If you're seeing this problem, you can do something like this:

  git mv --cached Test.txt test.txt

For a directory, you'd need to do this:

  git mv Test temp
  git mv temp test

That will move Test.txt into test.txt, which will solve your problem by
creating exactly one file.  If you prefer, you can do it the other way
as well.

That's the only possible solution if you're using a case-insensitive
file system; the other choice is to use the Windows 10 tools to make the
repository and its child directories case sensitive.
-- 
brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-12 23:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <DA41ECC7-D5D4-4E85-A4C3-C55CC2A73D53@hxcore.ol>
     [not found] ` <27608194-0D85-4D71-8D88-C1278D8DA173@hxcore.ol>
2020-08-12 19:58   ` Files 'Test.txt' and 'test.txt' are different in Git database, but are the same on Windows file system issue Viktor Hozhyi
2020-08-12 23:02     ` brian m. carlson

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).