The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

GitHub: creating a directory while adding on-line adding a file or uploading file(s)

Posted by jpluimers on 2025/03/20

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:

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.

nx based systems by default don’t show files starting with a . (period/dot): these files even are called dot files, so this is a convenient way.

More on this for instance at:

Queries

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.