Github is a fantastic platform for storing, discussing, and learning new programming languages. Creating a code repository is a breeze, but popular techniques of organization, such as how to create a folder in Github, are not obvious.
The procedure is straightforward, although it may take some getting used to if you’re coming from a more conventional operating system. Simply indicating folder structure with a forward slash is all that’s required. Below is a detailed guide on how to create a new folder in Github, with a list of potential pitfalls to watch out for.
Table of Content
Things You Should Know About Creating a Folder in GitHub
Adding a new folder to a GitHub repository is a straightforward process, although it isn’t immediately obvious how to do so. You can’t make empty folders, and you need a repository. If you meet those requirements, you can create a new folder by following these procedures:
- Verify that you are logged into a preexisting repository.
- If the repository is blank, choose “create a new file.”
- Create a new folder by entering its name in the input area, followed by a forward slash.
- In the new file’s naming field, enter the name you’d like to give the folder. Empty folders cannot be created on GitHub.
How to Create a Folder in GitHub
Step 1: Make Sure You Have a Repository

- The first step should be easy to understand, but let’s not make any assumptions. Start a new repository by going to your profile page and selecting the “Repositories” option.
- Alternatively, you can add a new folder to an already existing repository. Note that the slash character (/) is automatically converted to a hyphen when you create a new repository.
Step 2: Select “create a new file”

- After a repository is created or an existing one is chosen, you can access it directly from here. If the repository is empty, you will see a series of predefined messages outlining possible next steps. The first selection features a clickable anchor. Click “create a new file.”
- The screen that appears when you choose to create a new folder inside an existing repository will vary somewhat. For a fresh document, choose “Add File” and then “Create new file” from the resulting menu.
- Both this and starting from a fresh repository will bring up the appropriate window for creating a new file.
Step 3: You can make a new folder by typing a forward-slash character

- You can access the file-making dialogue box by clicking the “new file” link. A blank input field where the new file’s name.
- Create a new folder by typing its name, followed by a forward slash, then the path to which you want to save it. When a folder name begins with a forward slash (/), Github creates a new input field for the file.
- After entering the desired folder name and new file name, click the green “create file” button at the bottom of the page. There’s a spot for a commit message and explanation if you want to use it.
Step 4: Check That the Folder Was Created

- A new directory should have been created in your Github repository if you followed the instructions above.
- The new subfolder’s name and the report’s URL in the primary navigation bar will serve as evidence of this.