How do I get the SHA of HEAD in a specific git submodule?

ray

My project has multiple git submodules. I need the SHA commit of one submodule in particular to present in the app.

git submodule foreach accepts a command like rev-parse, but it loops over all submodules, which I don't want. git submodule status MySubmoduleFolder gives too much output.

ray

Found my own solution. Unlike cut, awk will ignore the first space.

git submodule status MySubmoduleFolder | awk '{print $1;}'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I replace a git submodule with another repo?

How do I move an existing Git submodule within a Git repository?

How do I revert my changes to a git submodule?

How do I "commit" changes in a git submodule?

How do I check out a specific version of a submodule using 'git submodule'?

How do I remove a submodule?

How to change HEAD of git submodule

How do I resolve git merge conflicts on a submodule from `git stash pop`

How do I add sub directory of directory as a git submodule?

How to do submodule sparse-checkout with Git?

Git submodule detached head state

How do you bundle submodule changes in git?

How to exclude a specific git submodule from update?

How do I get git submodule changes from parent to child repository?

Git submodule init to HEAD instead of specific commit

How do I "git add" a modified submodule into the main module?

How do I git extract all files in a sha to `/tmp`?

How can I go back to the HEAD after `git checkout SHA`

How do I add a git submodule that has no master branch?

How can I delete git submodule wreckage?

git: How do I get the hash of the latest commit in the current branch when in detached HEAD state?

How do I undo a `git reset --hard HEAD~1`?

How can I pull git submodule automatically?

How Can I Modify a Git Submodule So That It Is Attached to the Head

How do I exclude a git submodule from update using python?

How do I get the list of SHA values of all the files in a folder of my git repo using JGit library

How do I fix a Git detached head?

Bazel: submodule in project does not use bazel , pushing to git doesnt include locally added BUILD file in submodule, how do i build?

Do I need to manually commit/push Git submodule SHA while I am working inside the main repository?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  3. 3

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  4. 4

    pump.io port in URL

  5. 5

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    Do Idle Snowflake Connections Use Cloud Services Credits?

  9. 9

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

  10. 10

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  11. 11

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  12. 12

    Generate random UUIDv4 with Elm

  13. 13

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  14. 14

    Is it possible to Redo commits removed by GitHub Desktop's Undo on a Mac?

  15. 15

    flutter: dropdown item programmatically unselect problem

  16. 16

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  17. 17

    EXCEL: Find sum of values in one column with criteria from other column

  18. 18

    Pandas - check if dataframe has negative value in any column

  19. 19

    How to use merge windows unallocated space into Ubuntu using GParted?

  20. 20

    Make a B+ Tree concurrent thread safe

  21. 21

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

HotTag

Archive