Skip to content

How to create a folder in Github?

  • by
  • 2 min read

Github is one of the most important tools you need to utilise as a developer. Not only it makes version management and collaborative coding easier, but it’s also one of the best places to build codebases and have the community chime in with their ideas. 

In this article, we’re going to talk about how you can create a folder in Github. 

Also read: How to create a GitHub repository?


Creating Github folders

Before we make a folder in your Github repository, it’s important to note that Github doesn’t allow you to create a folder without adding at least one file. This doesn’t have to be a specific kind of code or script file and even an empty text file will do the job. 

To create a folder in Github, follow these steps. 

Step 1: Head over to your repository page and open any folder inside which you want the new folder. If you want to create a folder in your repository’s root directory, that’s fine too. Just click the Add file button and select Create new file from the drop-down. 

This is an image of github new folder 1

Step 2: In the file name field, enter your folder’s name and add a slash (/) to create the folder. Keep in mind that until you add a file, the change won’t take effect and the folder won’t be created. 

This is an image of github new folder 2

You can then add text or anything else to your file in the Edit new file window. 

Step 3: Once you’re done, scroll all the way down, add the commit name and description and click the Commit new file button to add a new file within the folder you just created. 

This is an image of github new folder 3

You can also choose to make the commit to the main repository branch or create a new one. 

Also read: How to delete a repository and branch in GitHub?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>