Logo

dev-resources.site

for different kinds of informations.

Have you ever used `git submodules`?

Published at
1/14/2025
Categories
opensource
nextjs
submodules
Author
ramunarasinga-11
Categories
3 categories in total
opensource
open
nextjs
open
submodules
open
Author
16 person written this
ramunarasinga-11
open
Have you ever used `git submodules`?

I am currently contributing to an open-source project called Grida, specifically working on building a canvas with a figma like interface. In order to setup the Grida’s development environment, you need to use git submodules. I didn’t know this, got a hint from the authors at Grida and I decided to share what is a git submodules command in this article.

Git Submodules

I am quoting below what I found in the git-scm site.

Image description

It often happens that while working on one project, you need to use another project from within it. Perhaps it’s a library that a third party developed or that you’re developing separately and using in multiple parent projects. A common issue arises in these scenarios: you want to be able to treat the two projects as separate yet still be able to use one from within the other.

Here’s an example. Suppose you’re developing a website and creating Atom feeds. Instead of writing your own Atom-generating code, you decide to use a library. You’re likely to have to either include this code from a shared library like a CPAN install or Ruby gem, or copy the source code into your own project tree. The issue with including the library is that it’s difficult to customize the library in any way and often more difficult to deploy it, because you need to make sure every client has that library available. The issue with copying the code into your own project is that any custom changes you make are difficult to merge when upstream changes become available.

Git addresses this issue using submodules. Submodules allow you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate

This documentation provides information on different scenarios such as:

  1. Starting with Submodules

  2. Cloning a Project with Submodules and so on…

but what worked for me in setting up the Grida development environment is this — Cloning a Project with Submodules

I study large open-source projects and provide insights, give my repository a star.

I initially tried to run the pnpm install, but I kept the getting errors about missing package.

I used the command to below to properly clone the Grida source code in my machine:

git clone --recurse-submodules https://github.com/gridaco/grida
Enter fullscreen mode Exit fullscreen mode

This command is going to clone the submodules that this project is dependent on and these submodules are different repositories themselves.

Executing this command only gets you all the submodules required, you would still need to run pnpm install and to start the development environment, run pnpm run dev

I highly recommend reading more about submodules.

About me:

Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.

I am open to work on interesting projects. Send me an email at [email protected]

My Github — https://github.com/ramu-narasinga

My website — https://ramunarasinga.com

My Youtube channel — https://www.youtube.com/@thinkthroo

Learning platform — https://thinkthroo.com

Codebase Architecture — https://app.thinkthroo.com/architecture

Best practices — https://app.thinkthroo.com/best-practices

Production-grade projects — https://app.thinkthroo.com/production-grade-projects

References:

  1. https://git-scm.com/book/en/v2/Git-Tools-Submodules

  2. https://github.com/gridaco/grida

  3. https://app.grida.co/canvas

opensource Article's
30 articles in total
Open-source projects foster collaboration and innovation, allowing anyone to view, modify, and share the code freely.
Favicon
Memory Management in Operating Systems
Favicon
2025: The Year of Decentralization – How Nostr Will Make You a Standout Developer
Favicon
10 Must-Bookmark Open Source Projects for Developers
Favicon
[Boost]
Favicon
join my project semester simulator
Favicon
340+ Websites every developer should know
Favicon
KDE vs GNOME vs Others: Choosing the Best Linux Desktop Environment in 2025
Favicon
assert in Nodejs and its usage in Grida source code
Favicon
Contribute to `real-to-sim-to-real` in SmilingRobo Open-Source Sprint!
Favicon
Exploring the CNCF Landscape: A Comprehensive Overview of Cloud Native Technologies
Favicon
🎁 20 Open Source Projects You Shouldn't Miss in 2025
Favicon
Any recommendations of open source asset inventory ?
Favicon
Getting Started with the Open Source AI Hackathon
Favicon
Supercharge Your JavaScript Agents with Firecrawl in KaibanJS
Favicon
Top 10 Trending GitHub Repositories, Nov 24 2024
Favicon
Open-Source TailwindCSS React Color Picker - Zero Dependencies! Perfect for Next.js Projects!
Favicon
Procrastinator’s Guide to Glory: Turning Wasted Time Into Career Gold with Open Source
Favicon
Kubernetes Security Best Practices
Favicon
SPL: a database language featuring easy writing and fast running
Favicon
7 Open-Source Tools for Better Website Analytics
Favicon
Train LLM From Scratch
Favicon
Have you ever used `git submodules`?
Favicon
✨ Introducing Tooltip: A Revolutionary Suite of Developer Tools** ✨
Favicon
Becoming An Open Source Maintainer
Favicon
Open-Source React Icon Picker: Lightweight, Customizable, and Built with ShadCN, TailwindCSS. Perfect for Next.js Projects!
Favicon
Enhance Your App's Security with OTP-Agent
Favicon
3 essential elements for Web publishing
Favicon
Pulumi WASM/Rust devlog #3
Favicon
Sign up to our bug bounty platform!
Favicon
lodash._merge vs Defu

Featured ones: