How to see status of a git submodule library?

Viewed 2421

I have a library in a git project which is a submodule, I will call it service-lib.

The serivce-lib is not developed by myself or my company, and in fact I am encouraged not to edit it.

How can I check the git status of this module to:

  1. Check to makes sure I haven't accidentally edited/created a file in it
  2. See any updates from the developers (i.e. so I can adopt any bug fixes they may have added)
3 Answers

Note that if you have only one submodule, seeing its status is even simpler:

git submodule

That is because, before Git 2.22 (Q2 0219), submodule's default behavior wasn't documented in both git-submodule.txt and in the usage text of git-submodule.

See commit 68cabbf (15 Feb 2019) by Denton Liu (Denton-L).
(Merged by Junio C Hamano -- gitster -- in commit c388c12, 07 Mar 2019)

Now the documentation includes:

With no arguments, shows the status of existing submodules.
Several subcommands are available to perform operations on the submodules.

Related