How to Create Directory in Github
In this article
Creating directories in GitHub repositories helps organize your code and files into logical folder structures. Since GitHub requires at least one file to exist within a directory, you'll need to create both the folder and an initial file simultaneously.
This tutorial walks you through the process of creating new directories directly in your GitHub repository using the web interface, making it easy to structure your project files effectively.
Here's how to create directory in GitHub
- Navigate to your GitHub repository and click the 'Add file' button.
- Choose 'Create new file' from the dropdown menu.
- Type your desired directory name followed by a forward slash in the filename field.
- Enter a filename after the directory path, such as 'README.md' or any other file.
- Add any necessary content to your new file.
- Scroll down and click the 'Commit changes' button.
- Enter a descriptive commit message and optional description for your changes.
- Click 'Commit changes' again to finalize the directory creation.
- Your new directory will now appear in your repository file structure.
Your turn to show how it works.
Build a walkthrough of your product with Saltfish, then share it with your customers.
Frequently Asked Questions
No, GitHub doesn't allow completely empty directories. You must create at least one file inside the directory for it to exist in your repository. This is a limitation of Git itself, not just GitHub's interface.



