4

Deleted files in a freshly cloned git repo

 11 months ago
source link: https://www.matuzo.at/blog/2023/deleted-files-clone/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Deleted files in a freshly cloned git repo

posted on May 29., 2023

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.

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 e-mail.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK