Dev Practical

How to create a folder in Github repository online

If don’t have access to Git command line or Github Desktop app, you can still create a folder using Github Website. Here is how you can do that.

  1. Open the Github repository in which you want to add a folder. Open Github repository
  2. Click on add file button. Add file options Github

  3. Click on create new file option. Create new file option Github

  4. Type the folder name on the text box that appears Type folder name Github

  5. Add a / (forward slash) at the end of the folder name. A new text box should appear after your folder name. View of folder name created Github

  6. Type a file name together with a filename extension on this new text box. Typing file name Github

  7. Scroll to the bottom and click the commit button. Commit file to Github

Important Notes

  1. You cannot create an empty folder on Github website.
  2. You cannot add, commit or push an empty folder even if you are using Git or Github Desktop app.
  3. Git keeps track of files and their locations in folders. So if a folder is empty, Git ignores it until you add a file inside it.