how do I clone files with colons in the filename

大憨熊 提交于 2019-12-17 09:54:06

问题


When I clone the repo using msysgit, all the files with spaces in the filename are not brought down, and then show as deleted in the status.

The filenames looks something like this: styles-ie (1:12:11 6:02 PM).css so it might actually be the colon or brackets?

How can I fetch those files to bring my local repo inline with the origin?


回答1:


If you try doing:

touch "styles-ie (1:12:11 6:02 PM).css"

you will see that you cannot create it on Windows.

Basically, the repo has the file ( the blob and the tree entry ) but you cannot checkout on Windows as git would be unable to create such a file. No other way but to change the filename.




回答2:


You can clone the repo on a linux environment, tar it up and copy it to windows, and untar it on windows with tools such as 7zip. 7zip will replace the colon with underscore, and preserve all the git information. As long as that file does not change, you'll be all set for a while. Those files tend not to change much anyway (for example, I have a cert file with a colon in the middle).



来源:https://stackoverflow.com/questions/5991805/how-do-i-clone-files-with-colons-in-the-filename

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