Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Sicherheitslücken (CVE)Pentagon Confirms Breached 3 Million DMDC Personnel Database(30.09.2026 um 18:50 Uhr)
•
IT Security NachrichtenMehr Frauenpower für die Cyberabwehr! - CRN DE(30.09.2026 um 15:51 Uhr)
•••
IT Security NachrichtenTerminalFix and Lorem Ipsum Loader enable covert tunneling(30.09.2026 um 02:00 Uhr)
•
IT Security NachrichtenAmazon Fire TV Stick 4K startet mit mehr Leistung, neuer Fernbedienung(30.09.2026 um 18:20 Uhr)
•
IT Security NachrichtenGod of War Laufey: Vorbestellungen für die PS5 sind ab sofort möglich(30.09.2026 um 18:40 Uhr)
•
IT Security NachrichtenGIGABYTE’s new OLED gaming monitors level up your gaming experience(30.09.2026 um 18:15 Uhr)
•
IT NachrichtenGemini Launches Skills, Kills Off Gems(30.09.2026 um 18:29 Uhr)
••
Sicherheitslücken (CVE)Pentagon Confirms Breached 3 Million DMDC Personnel Database(30.09.2026 um 18:50 Uhr)
•
IT Security NachrichtenMehr Frauenpower für die Cyberabwehr! - CRN DE(30.09.2026 um 15:51 Uhr)
•••
IT Security NachrichtenTerminalFix and Lorem Ipsum Loader enable covert tunneling(30.09.2026 um 02:00 Uhr)
•
IT Security NachrichtenAmazon Fire TV Stick 4K startet mit mehr Leistung, neuer Fernbedienung(30.09.2026 um 18:20 Uhr)
•
IT Security NachrichtenGod of War Laufey: Vorbestellungen für die PS5 sind ab sofort möglich(30.09.2026 um 18:40 Uhr)
•
IT Security NachrichtenGIGABYTE’s new OLED gaming monitors level up your gaming experience(30.09.2026 um 18:15 Uhr)
•
IT NachrichtenGemini Launches Skills, Kills Off Gems(30.09.2026 um 18:29 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Git Submodule Update

Submodules are git's solution for embedding a repository into another. Some of the most often use cases for submodules are the following: Embedding shared modules into multiple other repositories, Embedding the third-party…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Submodules are git's solution for embedding a repository into another. Some of the most often use cases for submodules are the following:




  • Embedding shared modules into multiple other repositories,

  • Embedding the third-party libraries,

  • Separating responsibilities and concerns, e.g. embedding different repos of the same project into the main one which then is in charge of their integration.



This article is a follow-up to the intro piece I wrote earlier and assumes familiarity with the concept of submodules. If you're not familiar with submodules, please take a look at the prequel first.






Updating Submodules to Latest Version




Submodules are like versioned third-party libraries. As an upgrade to the latest version of your dependency might break your code, so does an update to the latest version of the submodule.




To update your submodule to its latest version, do:




git submodule update






To review the commits that were added to the submodule, do:




git diff --submodule






After the code was tested against the new submodule version, commit the submodule by staging its path:




git add <the-submodule-path>
git commit -m "Update submodule to version XXX"






It's also important to have a meaningful commit message for it. If the submodule is not separately versioned, try to mention why the submodule was updated. E.g.




git commit -m "Update submodule to use Python 3.9"









Updating Submodule to a Specific Version



Now let's assume you want to upgrade (or downgrade) your submodule state to a specific version, e.g. a specific tag on the other repo or a specific branch, or even a specific commit.



Let's assume your submodule is under the path shared. Change your directory to this branch:




cd shared






If you have a terminal that shows the branches, it'll most likely show you a hash instead of a name:




~/the-repo/shared [(569d7ce...)]$






You can also run:




git branch






And the output will be something like:




* (HEAD detached at 569d7ce)
master






The "HEAD detached" state basically means that your current state of the submodule "has no name", i.e. no branch or tag points to that specific commit. If not, it's also good.



Now, all we want to do is to change the state of the submodule repo.






1. Update to a Specific Branch or Tag



To update your submodule to a specific branch or tag, simply switch to that branch or tag:




git switch specific-branch






Where specific-branch is the name of the branch you want to update your submodule to. This command is the same as:




git checkout specific-branch






We'll cover checkout vs switch in a later post.






2. Downgrade by One Commit



To go one commit back, one can checkout HEAD~1:




git checkout HEAD~1









3. Go to a Specific Commit



Now let's assume you want to change the state to a specific commit. First, find out the hash and checkout to it:




git checkout bfa784412503902f1d07edacb2e0e0954e2e221f









Get Back and Commit



Now that you're happy with the submodule state/version, you can get back to the original repo:




cd ..






To see what changes you made to the submodule, do:




git diff --submodule






It will list the commits that were added or removed, e.g.:




Submodule shared 43222e8..569d7ce (rewind):
< Add venv and pyc files to .gitignore
< Fix urllib3 version






This means the two mentioned commits were removed from the submodule (rewind).



Now, add the submodule and commit it:




git add shared
git commit -m "Rewind the commits"









Final Words



Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Git Submodule Update

Thematisch verwandte Begriffe: Submodule, Update · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-103432 | apcupsd through 3.14.14 has an sscanf stack-based buffer overflow in ge…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger • Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick