Git structure for easy collaboration: monorepo vs. multirepo?

Lately, while working on team projects, I hear this
concern a lot: "Our services are growing, and we're building multiple apps… Is it really okay to keep pushing everything into one repository?"
At first, it was convenient for everyone to work together in a single GitHub repository. But as
the number of files grew and CI/CD configurations started getting messy, the dilemma of 'monorepo vs. multirepo' gradually began.

I've been there too. When I was developing solo, I didn't think much about it, but once the team grew to about 3-5 people, the problems immediately surfaced.
Branch conflicts, test speed, PR merge order… each one directly impacts collaboration productivity.

So in this article, for those wondering like me, "How far should I go with one
repository?", I've summarized the differences between monorepos and multirepos, their pros and cons, the right timing for switching, and even practical structure examples.

I've broken it down step-by-step, from supermarket analogies to hands-on Git command practice
, so even if you're new to development, you can understand it. If you're currently debating your structure, use this article to get organized!

📌 Monorepo vs. Multirepo: Defining the Concepts

  • Monorepo: A method
    where the code for multiple projects (services) is managed together in a single repository.
  • Multirepo: A method where each
    project or service uses its own separate repository.

🪄 Monorepo vs. Multirepo Analogy (Think of it this way!)

  • A monorepo is like a single large supermarket where all items are stocked. You can buy everything
    you need in one place. It's efficient and fast.
  • Multirepo is like a market with separate fruit shops, bakeries, and butcher shops.
    Specialization is strong, but you have to visit multiple places.

💡 Usage Example (Actual Folder Structure)

Monorepo Structure Example

project-root/
├─ core/ # 핵심 기능 모듈
│ ├─ module1/
│ ├─ module2/
│ └─ ...
├─ apps/ # 사용자-facing 앱들
│ ├─ app1/
│ ├─ app2/
│ └─ ...
├─ shared/ # 공통 코드
│ ├─ security/
│ └─ quality/
├─ infra/ # 배포, 도커 등 인프라 설정
├─ .github/
│ └─ workflows/ # GitHub Action 자동화 설정
└─ tasks.json # 작업 관리용 설정 파일

Example Git Branch Strategy

BranchDescription
mainStable version, used for actual deployment
devBranch for integrating and testing multiple features
feat/Personal branch for new feature work → Merge into dev (PR)

🔄 Steps for a natural transition to multi-repository

  1. If a specific app is managed by a separate team, isolate only that app folder into a new repository. bash copy editgit filter-repo --subdirectory-filter apps/app1 --force
  2. Common code shared/ Reuse by separating directories into internal packages or submodules
  3. Set up CI/CD automation independently for each app (enabling separate deployments)

🧠 Where is it used? (Pros and cons of each approach)

✅ When a monorepo is advantageous

  • Project initiation phase
  • When the team is small (2-5 members)
  • When features frequently impact each other
  • When you want to test and make changes quickly

✅ When multi-repository is advantageous

  • When the project grows large and services become completely independent
  • When multiple teams develop in parallel
  • When separate deployment or security permissions are required per service

✅ Quick tip summary!

Start with a single repository (mono), split it when it grows (multi)!

🚀 Actionable steps to implement right now (Practical example)

(1) Create GitHub repository + initialize

gh repo create my-monorepo --private
cd my-monorepo && git init

(2) Create folder structure scaffold & make first commit

git add .
git commit -m "chore: initial scaffold with core & apps"
git push -u origin main

(3) Set up automated testing with GitHub Actions (.github/workflows/ci.yml)

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install -r requirements.txt
- run: pytest

(4) Set up VSCode workspace

  • .code-workspaceInclude the core/, apps/ Include the folder to enable search and testing in one go

(5) Adding Release Tags

git tag -a v0.1.0 -m "MVP scaffold"
git push origin v0.1.0

Now you can start with a monorepo for easy management, and when
things scale up, you can naturally transition to a multirepo setup! 😄

Leave a Comment

목차