Welcome! My name is Tomasz Buga, and this is shortz — short articles series that provides you solutions for your Software Development issues with simple to follow step-by-step guides.
Why would you want to create subfolders in your GitHub repository in the first place?
My answer is the monorepo.
I’ve encountered this issue recently when I was trying to create a monorepo for the app built with Spring Boot, PostgreSQL, and Angular. I had two separate GitHub repositories — one with a backend, and the second one with a frontend part of the application.
I wanted to use those codebases for my Test Automation Framework series, but since it’s not related to the Spring/Angular development, I wanted to make the setup, as quick as possible, for the people that would like to learn Test Automation from scratch.
Docker-compose was my go-to solution. A couple of hours later I had everything working like a charm. Sadly — I couldn’t make git commit with backend & frontend directories, as they were recognized as separate Git repositories.
Quick Google-fu & StackOverflow came to the rescue — as always.
How to create subfolders in your GitHub repository?
Important: To create a new subfolder there has to be at least one file within that subfolder (it’s related to the Git design)
- Go to the repository on your GitHub page, where you’d like to create a subfolder
- Click on the Add File > Create new File
- In the filename input field type folder name and follow it by “/” sign to create a new subfolder. You can use “../” to go up by one folder, and backspace enables you to edit the parent folder’s name
All the best,
Tomasz Buga, SDET
Monorepo - Wikipedia
In version control systems, a monorepo (" mono" meaning 'single' and "repo" being short for ' repository') is a…
Creating folders inside a GitHub repository without using Git
I want to add a new folder to my newly created GitHub repository without installing the Git setup for (Mac, Linux, and…
All illustrations made by Tomasz Buga