Git Submodules: Cheat Sheet

A submodule is a reference to another Git repository inside a project. Used to include an external library or shared code stored in a separate repository. 💡 A submodule stores a reference to a specific commit of the external repo, not the code. Add a submodule # Add a repo as a submodule to a specific path git submodule add <URL> <path/to/place> # Example git submodule add https://github.com/luizdepra/hugo-coder.git themes/hugo-coder # Commit changes git commit -m "Add submodule: themes/hugo-coder" git push After this, the project will have: ...

16 Mar 2026 · 2 min · 382 words · Potato Energy Team, ponfertato