Since git doesn’t have the notion of directories as entities, neither does GitHub.
This makes it counter-intuitive to add a sub-directory when creating a new file on-line in the GitHub web-UI or uploading file(s) there.
I wanted to do this as instead of taking the local route, it was easier to on-line add and edit [Wayback/Archive] GitHub – jpluimers/https-imgur.com-a-bmw-e61-remote-fix-sWdk0: Content from https://imgur.com/a/bmw-e61-remote-fix-sWdk0 for Wayback Machine archival.
The GitHub web-UI can indeed do this:
- [Wayback/Archive] How do I create a folder in a GitHub repository? – Stack Overflow
TL;DR Use
/in the file name field to create folder(s), e.g. typingfolder1/file1in the file name field will create a folderfolder1and a filefile1. - [Wayback/Archive] How to upload an entire folder? · community · Discussion #21962 · GitHub
you should just try to drag and drop your entire folder in the webui and it will upload whole folder.
Further reading
You can also do this from the git command-line, by adding an empty file in the directory first. By convention, usually a .gitkeep file is used for that though others use .gitignore files for it.





