This interactive demo was created free with Storylane in 2 minutes. Create your own demo
This interactive demo was created free with Storylane in 2 minutes. Create your own demo
Start free
All Tutorials /GitHub

How to Create Directory in Github

Updated on:
May 12, 2026
By:
Madhav Bhandari
Use this interactive demo to learn how to create a new directory in your GitHub repository.

Quick summary

Creating a directory in GitHub requires adding a new file with a folder path in the file name, since GitHub does not support empty folders. You complete the process by writing a commit message and clicking Commit changes to save the new directory to your repository.


Steps

  1. In your GitHub repository, click the Add file button.
  2. Select Create new file from the dropdown menu.
  3. In the Name your file input box, type the full file path including the directory name (e.g., new-folder/README.md).
  4. GitHub will automatically create a new-folder directory containing the README.md file.
  5. Add any required content to the file in the editor.
  6. Click Commit changes to open the commit dialog.
  7. Provide a commit message and an optional description for the change.
  8. Click Commit changes again to confirm and save to the repository.
  9. Confirm the new directory is visible in your repository and click on it to verify.
  10. The new directory is now successfully created and visible in your GitHub repository.

📌 Why this matters

Creating a directory directly in GitHub without using a local Git client is a common need for developers who manage repositories through the browser. GitHub does not allow empty folders, so understanding how to use the file path naming trick to create a new directory — by typing a folder name followed by a slash and a file name — saves significant time and avoids confusion. This workflow is essential for teams onboarding new contributors, organizing project structure, and maintaining clean repository layouts without requiring command-line access. Mastering this skill ensures faster repository setup and smoother collaboration across distributed development teams.
Your product deserves an interactive demo
Start free
Similar Articles
GitHub

How to Import a Project from GitHub to Replit

Madhav Bhandari
Director of Marketing @ Storylane
GitHub

How to Push Code from Replit to GitHub

Madhav Bhandari
Director of Marketing @ Storylane
GitHub

How to Connect Replit to GitHub

Madhav Bhandari
Director of Marketing @ Storylane
No items found.
Platform
Interactive Demos
Sandbox Demos
Buyer Hub
RepX
Integrations
Solutions
Product Marketers
Growth & Demand Gen
Sales Reps & AEs
Presales & SEs
Customer Success
Product Managers
Customers
Demo Showcase
Customer Stories
Finer Demos Club
Features
Demo Signals
Personalization
Deal Intelligence
Resources
Blog
The Plot
Tutorials
Events & webinars
Help Docs
What’s New
Demo Dundies
Company
Careers
Pricing
Partners
Contact
Trust Center
Backed by
Chrome Extension Icon
Chrome extension
Download
Desktop app
Download
Built in San Francisco Bay Area - ©2026 Storylane
Privacy PolicyTerms & Conditions
X Corp (formerly Twitter)LinkedIn
This website uses cookies to ensure you get the best experience on our website. Learn More
Got it
This website uses cookies to ensure you get the best experience on our website. Learn More
Got it