# git stash broken on MS Windows (automatically modify the files again)

5 messages from 2014-12-03 to 2014-12-03. Participants: Petr Bena, Aneurin Price.
Thread: https://gitlist.dev/t/38100

## Petr Bena, 2014-12-03 14:33

Subject: git stash broken on MS Windows (automatically modify the files again)
Message-ID: <CA+4EQ5d70JWiawt5zb9s6Vc3cDMApPmhdB2w+WLyfmWCcTQF4g@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B4EQ5d70JWiawt5zb9s6Vc3cDMApPmhdB2w%2BWLyfmWCcTQF4g%40mail.gmail.com

```
I have a mysterious problem with one of my git repositories that work
fine when I check it out on linux, but not when I do that on windows.

On windows, pile of files immediately change themselves - eg when I do
git diff I see a lot of changes. What is even more interesting, is
that when I do git stash, nothing happens (it tell me it stashed back,
but changes are still there, so i can keep stashing and stashing but
it doesn't help), I still have lot of dirty changes to tracked files
and I can't get rid of them in any way. It's pretty much like if files
were containing something what can't be stored on NTFS and windows
version of git would replace the content with something else.

Because it's private repository I unfortunately can't provide it's
content, but these files are mostly SQL text files, the screenshot (so
that colors are preserved), is here: http://snag.gy/93A8S.jpg

Is there any way to "fix" windows git so that it works? Did anyone
experience this? It may be something related to windows line endings,
but I am not really sure.

During installation of GIT I checked "keep line endings as they are in
repository"

Thanks

```

## Petr Bena, 2014-12-03 14:46

Subject: Re: git stash broken on MS Windows (automatically modify the files again)
Message-ID: <CA+4EQ5cfC2N+e6g7wnxDZnnPj3BKTyuMj=TxX90fB7o+_EiOBQ@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B4EQ5cfC2N%2Be6g7wnxDZnnPj3BKTyuMj%3DTxX90fB7o%2B_EiOBQ%40mail.gmail.com
In-Reply-To: <CA+4EQ5d70JWiawt5zb9s6Vc3cDMApPmhdB2w+WLyfmWCcTQF4g@mail.gmail.com>

```
I actually can't even commit these changes:

petr.bena@MW7H3TP5JJBR0I ~/Documents/repo (export)
$ git stash
Saved working directory and index state WIP on export: ee21f45 Updated inserts
HEAD is now at ee21f45 Updated inserts

petr.bena@MW7H3TP5JJBR0I ~/Documents/repo (export)
$ git checkout master
error: Your local changes to the following files would be overwritten by checkou
t:
        BSS/export_home_oracle/scripts_IDAEU001/RENEWAL_BED_NEW/script_sql/creat
e_new_bed.sql
        BSS/export_home_oracle/scripts_IDAEU001/appo/RENEWAL_BED/script_sql/crea
te_new_bed.sql
        BSS/export_home_oracle/scripts_IDAEU001/audit/audit_off.sql
        BSS/export_home_oracle/scripts_IDAEU001/audit/audit_on.sql
        BSS/export_home_oracle/scripts_IDAEU001/create_ts_transito.sql
        BSS/export_home_oracle/scripts_IDAEU006/RENEWAL_BED/script_sql/create_ne
w_bed.sql
        BSS/export_home_oracle/scripts_IDAEU006/bed/script_sql/create_new_bed.sq
l
Please, commit your changes or stash them before you can switch branches.
Aborting

petr.bena@MW7H3TP5JJBR0I ~/Documents/repo (export)
$ git commit -a
fatal: Will not add file alias 'BSS/export_home_oracle/scripts_IDAEU001/Audit/au
dit_off.sql' ('BSS/export_home_oracle/scripts_IDAEU001/audit/audit_off.sql' alre
ady exists in index)

On Wed, Dec 3, 2014 at 3:33 PM, Petr Bena <benapetr@gmail.com> wrote:
> I have a mysterious problem with one of my git repositories that work
> fine when I check it out on linux, but not when I do that on windows.
>
> On windows, pile of files immediately change themselves - eg when I do
> git diff I see a lot of changes. What is even more interesting, is
> that when I do git stash, nothing happens (it tell me it stashed back,
> but changes are still there, so i can keep stashing and stashing but
> it doesn't help), I still have lot of dirty changes to tracked files
> and I can't get rid of them in any way. It's pretty much like if files
> were containing something what can't be stored on NTFS and windows
> version of git would replace the content with something else.
>
> Because it's private repository I unfortunately can't provide it's
> content, but these files are mostly SQL text files, the screenshot (so
> that colors are preserved), is here: http://snag.gy/93A8S.jpg
>
> Is there any way to "fix" windows git so that it works? Did anyone
> experience this? It may be something related to windows line endings,
> but I am not really sure.
>
> During installation of GIT I checked "keep line endings as they are in
> repository"
>
> Thanks

```

## Petr Bena, 2014-12-03 14:48

Subject: Re: git stash broken on MS Windows (automatically modify the files again)
Message-ID: <CA+4EQ5fbDPFuzuz_OAX1Y=zCdL76j3ah0u0BVUW2pPqjaf4kBQ@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B4EQ5fbDPFuzuz_OAX1Y%3DzCdL76j3ah0u0BVUW2pPqjaf4kBQ%40mail.gmail.com
In-Reply-To: <CA+4EQ5cfC2N+e6g7wnxDZnnPj3BKTyuMj=TxX90fB7o+_EiOBQ@mail.gmail.com>

```
Only solution so far was to clone on linux, remove the folder which
contains these files and push them, then I had to delete the whole
repository on windows and clone it again.

If I checkout any revision which contains these files repository get
broken in a way that only solution is deleting it from disk and
cloning again. Is this a bug?

On Wed, Dec 3, 2014 at 3:46 PM, Petr Bena <benapetr@gmail.com> wrote:
> I actually can't even commit these changes:
>
> petr.bena@MW7H3TP5JJBR0I ~/Documents/repo (export)
> $ git stash
> Saved working directory and index state WIP on export: ee21f45 Updated inserts
> HEAD is now at ee21f45 Updated inserts
>
> petr.bena@MW7H3TP5JJBR0I ~/Documents/repo (export)
> $ git checkout master
> error: Your local changes to the following files would be overwritten by checkou
> t:
>         BSS/export_home_oracle/scripts_IDAEU001/RENEWAL_BED_NEW/script_sql/creat
> e_new_bed.sql
>         BSS/export_home_oracle/scripts_IDAEU001/appo/RENEWAL_BED/script_sql/crea
> te_new_bed.sql
>         BSS/export_home_oracle/scripts_IDAEU001/audit/audit_off.sql
>         BSS/export_home_oracle/scripts_IDAEU001/audit/audit_on.sql
>         BSS/export_home_oracle/scripts_IDAEU001/create_ts_transito.sql
>         BSS/export_home_oracle/scripts_IDAEU006/RENEWAL_BED/script_sql/create_ne
> w_bed.sql
>         BSS/export_home_oracle/scripts_IDAEU006/bed/script_sql/create_new_bed.sq
> l
> Please, commit your changes or stash them before you can switch branches.
> Aborting
>
> petr.bena@MW7H3TP5JJBR0I ~/Documents/repo (export)
> $ git commit -a
> fatal: Will not add file alias 'BSS/export_home_oracle/scripts_IDAEU001/Audit/au
> dit_off.sql' ('BSS/export_home_oracle/scripts_IDAEU001/audit/audit_off.sql' alre
> ady exists in index)
>
> On Wed, Dec 3, 2014 at 3:33 PM, Petr Bena <benapetr@gmail.com> wrote:
>> I have a mysterious problem with one of my git repositories that work
>> fine when I check it out on linux, but not when I do that on windows.
>>
>> On windows, pile of files immediately change themselves - eg when I do
>> git diff I see a lot of changes. What is even more interesting, is
>> that when I do git stash, nothing happens (it tell me it stashed back,
>> but changes are still there, so i can keep stashing and stashing but
>> it doesn't help), I still have lot of dirty changes to tracked files
>> and I can't get rid of them in any way. It's pretty much like if files
>> were containing something what can't be stored on NTFS and windows
>> version of git would replace the content with something else.
>>
>> Because it's private repository I unfortunately can't provide it's
>> content, but these files are mostly SQL text files, the screenshot (so
>> that colors are preserved), is here: http://snag.gy/93A8S.jpg
>>
>> Is there any way to "fix" windows git so that it works? Did anyone
>> experience this? It may be something related to windows line endings,
>> but I am not really sure.
>>
>> During installation of GIT I checked "keep line endings as they are in
>> repository"
>>
>> Thanks

```

## Aneurin Price, 2014-12-03 16:50

Subject: Re: git stash broken on MS Windows (automatically modify the files again)
Message-ID: <CAHb+SPAw+aeR4RsB6COhq4RMxuXJ64scY-Ez5tZPk3ziEAGm=Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAHb%2BSPAw%2BaeR4RsB6COhq4RMxuXJ64scY-Ez5tZPk3ziEAGm%3DQ%40mail.gmail.com
In-Reply-To: <CA+4EQ5fbDPFuzuz_OAX1Y=zCdL76j3ah0u0BVUW2pPqjaf4kBQ@mail.gmail.com>

```
On 3 December 2014 at 14:48, Petr Bena <benapetr@gmail.com> wrote:
> Only solution so far was to clone on linux, remove the folder which
> contains these files and push them, then I had to delete the whole
> repository on windows and clone it again.
>
> If I checkout any revision which contains these files repository get
> broken in a way that only solution is deleting it from disk and
> cloning again. Is this a bug?
>

<snip>

>> fatal: Will not add file alias 'BSS/export_home_oracle/scripts_IDAEU001/Audit/au
>> dit_off.sql' ('BSS/export_home_oracle/scripts_IDAEU001/audit/audit_off.sql' alre
>> ady exists in index)
>>

On your Linux machine (and in the repository), do you actually have
both 'BSS/export_home_oracle/scripts_IDAEU001/Audit' and
'BSS/export_home_oracle/scripts_IDAEU001/audit' directories?

```

## Petr Bena, 2014-12-03 17:03

Subject: Re: git stash broken on MS Windows (automatically modify the files again)
Message-ID: <CA+4EQ5e6464+MP7TqWMT8ceO6ZgZEE6xJPxJBfpAhoj4B-03Uw@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B4EQ5e6464%2BMP7TqWMT8ceO6ZgZEE6xJPxJBfpAhoj4B-03Uw%40mail.gmail.com
In-Reply-To: <CAHb+SPAw+aeR4RsB6COhq4RMxuXJ64scY-Ez5tZPk3ziEAGm=Q@mail.gmail.com>

```
Yay

Why doesn't windows git perform some kind of check here, and doesn't
tell you a message like: this repository contains multiple files with
same name, which I can't checkout on this OS Or something like that?

On Wed, Dec 3, 2014 at 5:50 PM, Aneurin Price <aneurin.price@gmail.com> wrote:
> On 3 December 2014 at 14:48, Petr Bena <benapetr@gmail.com> wrote:
>> Only solution so far was to clone on linux, remove the folder which
>> contains these files and push them, then I had to delete the whole
>> repository on windows and clone it again.
>>
>> If I checkout any revision which contains these files repository get
>> broken in a way that only solution is deleting it from disk and
>> cloning again. Is this a bug?
>>
>
> <snip>
>
>>> fatal: Will not add file alias 'BSS/export_home_oracle/scripts_IDAEU001/Audit/au
>>> dit_off.sql' ('BSS/export_home_oracle/scripts_IDAEU001/audit/audit_off.sql' alre
>>> ady exists in index)
>>>
>
> On your Linux machine (and in the repository), do you actually have
> both 'BSS/export_home_oracle/scripts_IDAEU001/Audit' and
> 'BSS/export_home_oracle/scripts_IDAEU001/audit' directories?

```
