* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Tuesday, July 1, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Nantucket Dance Festival opens July 8 – The Inquirer and Mirror

    Nantucket Dance Festival Launches with Thrilling Performances Beginning July 8

    A Secret Society, Ritualistic Killings, and a Century-Old Curse Netflix and YRF Entertainment’s ‘Mandala Murders’ Premieres July 25 – About Netflix

    A Secret Society, Ritualistic Killings, and a Century-Old Curse: Dive into the Chilling World of ‘Mandala Murders’ Premiering July 25

    Susquehanna Raises Penn Entertainment Inc. (PENN) Price Target. – Yahoo Finance

    Susquehanna Raises Price Target for Penn Entertainment Inc. (PENN)

    George Lopez is coming to Spokane – KXLY.com

    George Lopez is coming to Spokane – KXLY.com

    Netflix unveils Dallas immersive venue for fans of hit shows like ‘Squid Game,’ ‘Stranger Things’ – Houston Chronicle

    Step Inside Netflix’s New Dallas Immersive Experience Featuring Hits Like ‘Squid Game’ and ‘Stranger Things

    ‘Puttin’ on the Ritz’: Civic Players bring ‘Young Frankenstein’ to life – Yahoo

    Civic Players Deliver a Hilarious and Unforgettable Performance of ‘Young Frankenstein

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Owls inspire new revolutionary noise reduction technology – KTEN

    Owls inspire new revolutionary noise reduction technology – KTEN

    New center coming to Mizzou will focus on energy research and technology – Columbia Missourian

    Mizzou Launches Innovative New Center Dedicated to Energy Research and Technology

    Mirrors in space and underwater curtains: can technology buy us enough time to save the Arctic ice caps? – The Guardian

    Can Technology Like Space Mirrors and Underwater Curtains Buy Us Time to Save the Arctic Ice Caps?

    Naples restaurant owner prepares for hurricane season with new flood technology – Fox4Now.com

    Naples restaurant owner prepares for hurricane season with new flood technology – Fox4Now.com

    Emerging Memory and Storage Technology Market Analysis Report 2025-2034 | AI and HPC Boom Fuels Surging Demand for Fast, Low-Power Memory Devices – Yahoo Finance

    How AI and HPC Are Driving Explosive Growth in Fast, Low-Power Memory Technologies Through 2034

    Ostin Technology (OST): Volatility’s Warning or Contrarian Opportunity? – AInvest

    Ostin Technology (OST): Navigating Market Volatility – Red Flag or Hidden Opportunity?

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Nantucket Dance Festival opens July 8 – The Inquirer and Mirror

    Nantucket Dance Festival Launches with Thrilling Performances Beginning July 8

    A Secret Society, Ritualistic Killings, and a Century-Old Curse Netflix and YRF Entertainment’s ‘Mandala Murders’ Premieres July 25 – About Netflix

    A Secret Society, Ritualistic Killings, and a Century-Old Curse: Dive into the Chilling World of ‘Mandala Murders’ Premiering July 25

    Susquehanna Raises Penn Entertainment Inc. (PENN) Price Target. – Yahoo Finance

    Susquehanna Raises Price Target for Penn Entertainment Inc. (PENN)

    George Lopez is coming to Spokane – KXLY.com

    George Lopez is coming to Spokane – KXLY.com

    Netflix unveils Dallas immersive venue for fans of hit shows like ‘Squid Game,’ ‘Stranger Things’ – Houston Chronicle

    Step Inside Netflix’s New Dallas Immersive Experience Featuring Hits Like ‘Squid Game’ and ‘Stranger Things

    ‘Puttin’ on the Ritz’: Civic Players bring ‘Young Frankenstein’ to life – Yahoo

    Civic Players Deliver a Hilarious and Unforgettable Performance of ‘Young Frankenstein

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Owls inspire new revolutionary noise reduction technology – KTEN

    Owls inspire new revolutionary noise reduction technology – KTEN

    New center coming to Mizzou will focus on energy research and technology – Columbia Missourian

    Mizzou Launches Innovative New Center Dedicated to Energy Research and Technology

    Mirrors in space and underwater curtains: can technology buy us enough time to save the Arctic ice caps? – The Guardian

    Can Technology Like Space Mirrors and Underwater Curtains Buy Us Time to Save the Arctic Ice Caps?

    Naples restaurant owner prepares for hurricane season with new flood technology – Fox4Now.com

    Naples restaurant owner prepares for hurricane season with new flood technology – Fox4Now.com

    Emerging Memory and Storage Technology Market Analysis Report 2025-2034 | AI and HPC Boom Fuels Surging Demand for Fast, Low-Power Memory Devices – Yahoo Finance

    How AI and HPC Are Driving Explosive Growth in Fast, Low-Power Memory Technologies Through 2034

    Ostin Technology (OST): Volatility’s Warning or Contrarian Opportunity? – AInvest

    Ostin Technology (OST): Navigating Market Volatility – Red Flag or Hidden Opportunity?

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
Earth-News
No Result
View All Result
Home Science

What Are Git Submodules, and How Do You Use Them?

July 15, 2023
in Science
What Are Git Submodules, and How Do You Use Them?
Share on FacebookShare on Twitter

Git submodules are a way of including one Git repository as a subdirectory of another repository. This kind of source code nesting can be very useful for projects that want finer control over their dependencies and build process, and it’s easy to set up.

Why Use Submodules?

When you add a submodule to a Git repository, you’re essentially creating a link between the two repositories. The main repository and the submodule repository can be updated independently of one another. The parent repository will contain a remote URL as well as a reference to the checked-out commit ID in the submodule’s history. When you clone the parent repository, it will clone the submodules as well.

This can be useful if you have a project that depends on code from another project, and you want to keep the two projects (and their version histories) separate, but still be able to easily work with both of them.

The primary alternative to submodules is using package managers like NPM, NuGet, or Maven. Package managers provide a centralized repository of packages and libraries that can be easily installed and updated. However, you must publish a specific version of each package you want to consume. And if your code is private, you must use your own private package registry.

Git submodules allow you to manage dependencies more closely than most package managers. With submodules, you can choose exactly which versions of each dependency you want to include in your project, and it’s easier to update the commit ID of the submodule than it is to publish a new package.

Submodules also make it easier to maintain and use forks of common libraries, which is something that many companies opt for when additional features or customization is necessary. Ultimately, if you’re maintaining a repository for the module, and need fine-grained control over your dependencies, you may want to consider using submodules instead of package managers.

How to Use Git Submodules

If you’re cloning a repository that already uses submodules, most of the work has been done for you already. Your git client should automatically clone and download the submodule repository, and it should update whenever other maintainers push changes to the submodule.

If it doesn’t, you may need to run git clone with the –recursive flag, which will scan and update all submodules.

git clone –recurse-submodules URL

Adding a new submodule is fairly straightforward. If you’re adding a brand new submodule from a source repository, you’ll just have to run git submodule add:

git submodule add URL submodule_directory

This will download the submodule repository from the URL and clone it into the submodule_directory folder.

However, if you want to convert an existing folder, the process is a bit more complicated. You can read our guide to converting a directory into a submodule here, but the process involves cloning your main repo again, filtering the commit history to only include the module directory, and then pushing the submodule to a new repository.

Once you add the submodule, you will need to commit the changes to the parent repository. This will update the configuration for everyone else that pulls the parent repository.

git commit -m “Added submodule submodule_directory”

Updating Git Submodules

If someone else updated the submodule, or you need to pull updates from the submodule’s repository, you’ll want to use git submodule update:

git submodule update –remote

However, if you need to make changes yourself, it becomes a little trickier. Making changes to code in Git submodules requires a bit of extra care compared to updating code in a regular Git repository, and you generally have two options:

Make the changes in a separate repository for the submodule, and commit and update them as normal. You will need to run git submodule update in the parent repository to pull the new changes.
Make the changes inside the parent repository. Since a submodule is basically an embedded Git repository, you’re able to cd into the submodule directory and run Git commands as normal. This is one of the main benefits of submodules, as you can maintain separate repos while working on both at the same time.

If you’re making changes inside the parent repository, you’ll need to cd into the submodule and update:

cd submodule_dir
git commit -am “submodule commit”
git push

Then, head back up to the parent repo and push the updates to the submodule to the parent’s repository:

cd ..
git commit -am “updated submodule”

git push

You should see changes both on the submodule’s Github repository as well as the parent repository.

>>> Read full article>>>
Copyright for syndicated content belongs to the linked Source : How To Geek – https://www.howtogeek.com/devops/what-are-git-submodules-and-how-do-you-use-them/

Tags: scienceSubmodules
Previous Post

How to Create and Manage GitHub Templates to Easily Create New Projects

Next Post

How to Automatically Publish GitHub Releases From Git Tags

These 9 towns were named the ‘quirkiest’ in New Jersey, according to World Atlas – Bergen Record

These 9 towns were named the ‘quirkiest’ in New Jersey, according to World Atlas – Bergen Record

July 1, 2025
Trump’s Tax Bill Won’t Help or Hurt the Economy. The Deficit Is Already Huge. – Barron’s

Trump’s Tax Bill Won’t Help or Hurt the Economy. The Deficit Is Already Huge. – Barron’s

July 1, 2025
Nantucket Dance Festival opens July 8 – The Inquirer and Mirror

Nantucket Dance Festival Launches with Thrilling Performances Beginning July 8

July 1, 2025
Who would be affected by health care cuts in Senate version of Trump’s budget bill – PBS

Who Will Be Hit Hardest by Health Care Cuts in the Senate’s Trump Budget Plan?

July 1, 2025
Senate passes Trump’s reconciliation bill with Vance casting tie-breaking vote – PBS

Senate Passes Trump’s Reconciliation Bill After Vance Casts Decisive Tie-Breaking Vote

July 1, 2025
Groundbreaking technology to help police tackle violence against women – The Independent

Revolutionary Technology Transforms the Fight Against Violence Toward Women

July 1, 2025
Apple Inc. (AAPL) Adds Tennis To Its List of Supported Sports Ahead of Wimbledon – Yahoo Finance

Apple Inc. (AAPL) Adds Tennis To Its List of Supported Sports Ahead of Wimbledon – Yahoo Finance

July 1, 2025
Nature’s headlamps: A unique light-focusing structure in Parasesarma de Man, 1895 mangrove crabs – ESA Journals

Nature’s headlamps: A unique light-focusing structure in Parasesarma de Man, 1895 mangrove crabs – ESA Journals

July 1, 2025
Scientists found what just might be Earth’s oldest rocks – Boy Genius Report

Scientists found what just might be Earth’s oldest rocks – Boy Genius Report

July 1, 2025
The EU must show leadership and stand up for science, health and women’s rights – The Parliament Magazine

Why the EU Needs to Take the Lead in Protecting Science, Health, and Women’s Rights

July 1, 2025

Categories

Archives

July 2025
MTWTFSS
 123456
78910111213
14151617181920
21222324252627
28293031 
« Jun    
Earth-News.info

The Earth News is an independent English-language daily published Website from all around the World News

Browse by Category

  • Business (20,132)
  • Ecology (701)
  • Economy (726)
  • Entertainment (21,615)
  • General (15,655)
  • Health (9,766)
  • Lifestyle (731)
  • News (22,149)
  • People (726)
  • Politics (733)
  • Science (15,943)
  • Sports (21,223)
  • Technology (15,710)
  • World (707)

Recent News

These 9 towns were named the ‘quirkiest’ in New Jersey, according to World Atlas – Bergen Record

These 9 towns were named the ‘quirkiest’ in New Jersey, according to World Atlas – Bergen Record

July 1, 2025
Trump’s Tax Bill Won’t Help or Hurt the Economy. The Deficit Is Already Huge. – Barron’s

Trump’s Tax Bill Won’t Help or Hurt the Economy. The Deficit Is Already Huge. – Barron’s

July 1, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

Go to mobile version