Git clone unable to create file

点点圈 提交于 2019-12-05 03:04:47

I guess you're probably trying to do the clone on a Windows machine. Windows doesn't allow filenames to use the : character.

From the Microsoft documentation:

Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:

  • The following reserved characters:
    • < (less than)
    • > (greater than)
    • : (colon)
    • " (double quote)
    • / (forward slash)
    • \ (backslash)
    • | (vertical bar or pipe)
    • ? (question mark)
    • * (asterisk)
  • Integer value zero, sometimes referred to as the ASCII NUL character.
  • Characters whose integer representations are in the range from 1 through 31, except for alternate data streams where these characters are allowed. For more information about file streams, see File Streams.
  • Any other character that the target file system does not allow.

To work around this problem, you will probably need to clone on a non-windows system and correct the offending filenames. Maybe some of the windows experts out there will have a better solution.

morty

I'm cross-referencing my answer, as it also applies here: https://stackoverflow.com/a/34515900/1012586

Yet instead of

*
!kickstarter/parsers/data/kickstarter/campaigndetails/*

you'd need something like

*
!frozen/email/lamson/mymailserver/run/queue/mark.name/cur/*

in your .git/info/sparse-checkout

git will refuse to overwrite existing files. Try again, cloning into an empty directory.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!