Git for Noob-to-Pro — #4(Module)

Search for a command to run...

No comments yet. Be the first to comment.
Bun, the hyper-fast JavaScript runtime known for its incredible speed and Zig-based architecture, is being completely rewritten in Rust. For a project that has over 22 million monthly downloads and ea

Next.js 16.3 is almost here, and it's packed with a ton of improvements and let's see them in this post 1.Instant Navigation For a while now, there’s been a valid, lingering debateServer Components vs

It’s official. React has merged its long-awaited Rust port of the React Compiler (formerly known as React Forget) into the main repository. What started as an experimental research project by Joseph S

If you follow modern technology trends, you have likely been led to believe that artificial intelligence is entirely built on Python. Every tutorial, machine learning framework documentation, and open

Just when the JavaScript ecosystem was catching its breath after last week’s TanStack Router compromise, the Mini Shai-Hulud supply chain worm has continued its relentless march. Developed by the thre

If you don’t have time to read but want to know what’s there in this series. Find the quick read 👇

We are going to see the commonly used Git snippets for the repository which will make you from Noob to Pro.
The Git Repository snippets that we are going to look at in this series are
Local Repository
Branches
Commits
Module
Stash
In this post, we are going to see the topic Module which has the following sub-topics like
Add a submodule
Pull all submodules from remote
Clone missing submodules
Delete a submodule

Adds a new submodule to the repository.
git submodule add <upstream-path> <local-path> to add a new submodule from <upstream-path> to <local-path>.git submodule add
# Example
git submodule add https://github.com/nidhinkumar06/HTML-LayoutPatterns ./patterns
# Creates the directory `patterns` containing the submodule from
# "https://github.com/nidhinkumar06/HTML-LayoutPatterns"
Pulls all submodules from their respective remotes.
git submodule update --recursive --remote to pull all submodules from their respective remotes.git submodule update --recursive --remote
**# Example
**git submodule update --recursive --remote
# Pulls all submodules from their respective remotes
Clones missing submodules and checks out commit.
git submodule update --init --recursive to clone missing submodules and checkout commits.git submodule update --init --recursive
# Example
git submodule update --init --recursive
# Clones missing submodules and checks out commits
Deletes a submodule from the repository.
Use git submodule deinit -f -- <submodule> to unregister the specified <submodule>.
Use rm -rf .git/modules/<submodule> to remove the directory of the submodule.
Use git rm -f <submodule> to remove the working tree of the submodule.
git submodule deinit -f --
rm -rf .git/modules/
git rm -f
**# Example
**git submodule deinit -f -- patterns
rm -rf .git/modules/patterns
git rm -f patterns
# Removes the `patterns` submodule
