Git

How do I Create a Folder in a GitHub Repository?

When multiple people are working on the same project as a team, it is hard for them to update everyone about their completed or updated source code file. Therefore, they need to connect through the tracking remote host or server. To do so, GitHub hosting service is one of the most commonly utilized tracking tools.

On this platform, developers work on local repositories with the help of a local machine. After completing their assigned tasks, they push them to the GitHub repositories and update the other team members. On GitHub, you are also permitted to create or add new folders for multiple purposes.

This write-up provides the method of creating a folder in the GitHub hosting repository.

How do I Create a GitHub Repository Folder?

To create a folder in the GitHub hosting repository, follow the below-stated instructions:

  • Open the browser and move to the GitHub hosting repository.
  • Go to the remote repository and create a new folder.
  • Type the forward slash “/” after the folder name.

Step 1: Go to GitHub Repository

First of all, open your web browser, visit the GitHub account, and navigate to a particular remote repository in which you want to create a new folder:

Step 2: Access Add File Menu

Next, hit the “Add File” and choose the “Create New File” option from the appeared drop-down menu:

Step 3: Provide Folder Name

Then, type the name in the required field which you want to assign:

Step 4: Create File

Add the forward slash “/” at the end of the folder name and then add a file name:

Note: On GitHub, the users are not allowed to create an empty folder.

Step 5: Edit Newly Created File

In the next step, add some piece of code or text in the new file:

Step 6: Add Commit

Add the commit message in the required fields for committing the file to the repository:

Step 7: Select Branch and Commit

Now, select the remote branch in which you want to make a commit and click on the “Commit new file” button:

It can be seen that we have successfully created a folder in the GitHub repository:

You have learned the method of creating a folder in a GitHub repository.

Conclusion

To create a folder in the GitHub hosting repository, first, open up the web browser and move to the GitHub account. Then, navigate to the desired remote directory, hit the “Add File” button, and choose the “Create new file” option. Specify the folder name, add the forward slash “/” at the end of it and press the “Enter” key. After that, create a file and commit it to the remote repository. This write-up explained the method of creating a folder in the GitHub hosting repository.

About the author

Maria Naz

I hold a master's degree in computer science. I am passionate about my work, exploring new technologies, learning programming languages, and I love to share my knowledge with the world.