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.
Found my own solution. Unlike cut
, awk
will ignore the first space.
git submodule status MySubmoduleFolder | awk '{print $1;}'