This content originally appeared on Manuel Matuzović - Blog and was authored by Manuel Matuzović
The other day someone emailed me and told me that they tried to clone the HTMHell repo, but they only got an empty folder (except for the hidden .git folder), and all files were deleted as if they cloned the repo and immediately moved all files into the trash.
I couldn't reproduce the issue on my Mac, but I had the same problem on my Windows machine. This post on StackOverflow suggested that it was related to using forbidden characters in file names.
Forbidden characters in file names on Windows:
- < (less than)
- > (greater than)
- : (colon)
- " (double quote)
- / (forward slash)
- \ (backslash)
- | (vertical bar or pipe)
- ? (question mark)
- * (asterisk)
I reviewed the files and found an image named 30-bullet-"list".png. I have a node script that automatically creates the social media preview images for blog posts and uses the title as the file name. I forgot to take care of special characters.
I tweaked the script and renamed the file, and – voilà – cloning now works as expected on Windows.
Edit: Tane added on social media that he had an issue raised once on one of his repos because he was using an emoji in a filename and it broke on OSX.
Conclusion: Don't use special characters, spaces, or emojis in your file names.
My blog doesn't support comments yet, but you can reply via blog@matuzo.at.
This content originally appeared on Manuel Matuzović - Blog and was authored by Manuel Matuzović
Manuel Matuzović | Sciencx (2023-05-29T00:00:00+00:00) Deleted files in a freshly cloned git repo. Retrieved from https://www.scien.cx/2023/05/29/deleted-files-in-a-freshly-cloned-git-repo-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.