问题
What I am trying to do is a git clone on windows, but the parent repository exists in a unix machine.
Am cloning using ssh to get a clone from UNIX to windows, and I get this weird error.
error: git checkout-index: unable to create file <filename>
This happens during the checkout step of a git clone.
Can anyone help me?
回答1:
The answer should be:we can't create a file named aux.c in windows!
See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx Do not use the following reserved device names for the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.
回答2:
Was your directory plus your filenames too long for Windows? I came across this problem once, and it was fixed when I tried cloning into a lower directory.
回答3:
A common problem is two files whose names differ only by case — git assumes a case sensitive system. If the repository contains both FOO
and foo
, then attempting to create one after the other will fail.
回答4:
Maybe related to Git checkout and reset on Windows occasionally shows random files have changed
来源:https://stackoverflow.com/questions/3689137/error-git-checkout-index-unable-to-create-file