简体   繁体   English

Git奇怪的删除问题在Windows上

[英]Git weird deletion issue on Windows

The most of the work done in project was done on Linux platform, but now I'm trying to setup a clone on Windows platform. 项目中完成的大部分工作都是在Linux平台上完成的,但现在我正在尝试在Windows平台上设置克隆。

The problem is that upon git clone a file foo.bar appears to be immediately deleted (and marked so in uncommited changes). 问题是,在git clone ,文件foo.bar似乎立即被删除(并在未经修改的更改中标记为)。

Checking git ls-files shows that file foo.bar is present in index. 检查git ls-files表明文件foo.bar存在于索引中。

I did some research and noticed the following chronology: 我做了一些研究并注意到以下年代表:

Commit# .... Status 提交#....状态

100 .... Current HEAD 100 ....当前的HEAD

45 .... foo.bar modified (by me) 45 .... foo.bar修改(由我)

44 .... foo.bar deleted (by rookie teammate who never saw git before) 44 .... foo.bar删除了(以前从未见过git的新秀队友)

25 .... foo.bar modified (by me) 25 .... foo.bar修改(由我)

24 .... foo.bar created (by me) 24 .... foo.bar创建(由我)

I currently have no idea what I was doing to restore the file in commit #44. 我目前不知道我在提交#44中恢复文件的工作。 But I guess I did git checkout commit43 -- foo.bar , I might have done something else somewhere else, but I have no idea what really happened. 但我想我做了git checkout commit43 -- foo.bar ,我可能在其他地方做了别的事,但我不知道到底发生了什么。

Currently the repository on Windows platform will not let me checkout the file foo.bar . 目前Windows平台上的存储库不允许我签出文件foo.bar Deleting repository and re-cloning results in the state I mentioned above. 在上面提到的状态下删除存储库并重新克隆结果。

On Linux platforms however, clone works 'perfectly' ie the file is there. 然而,在Linux平台上,克隆“完美”工作,即文件就在那里。

Please help me understand what went wrong and how to fix this. 请帮助我了解出了什么问题以及如何解决这个问题。

EDIT: 编辑:

For the record. 作为记录。 The original filename is called aux.py and its a Windows issue. 原始文件名称为aux.py ,是Windows问题。

You cannot create files named aux.* on windows. 您无法在Windows上创建名为aux.*文件。 The easiest solution is to rename the file and clone the repository again. 最简单的解决方案是重命名文件并再次克隆存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM