threads / discuss / 38100

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

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

## tl;dr

5 messages between Dec 3, 2014 and Dec 3, 2014.

replies: 4people: 2as markdown or json

Petr Bena· Dec 3, 2014, 14:33 UTC · lore

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· Dec 3, 2014, 14:46 UTC · re: Petr Bena · lore

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

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:
Show 24 quoted lines
> 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· Dec 3, 2014, 14:48 UTC · re: Petr Bena · lore

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

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:
Show 56 quoted lines
> 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· Dec 3, 2014, 16:50 UTC · re: Petr Bena · lore

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

On 3 December 2014 at 14:48, Petr Bena <benapetr@gmail.com> wrote:
Show 8 quoted lines
> 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· Dec 3, 2014, 17:03 UTC · re: Aneurin Price · lore

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

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:
Show 20 quoted lines
> 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?

← back to recent threads