Skip to content

Instantly share code, notes, and snippets.

@sabman

sabman/git.md Secret

Last active May 14, 2022 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sabman/8e140902ee057e286f504ea39b0487a7 to your computer and use it in GitHub Desktop.
Save sabman/8e140902ee057e286f504ea39b0487a7 to your computer and use it in GitHub Desktop.

How should one handle commit messages when updating git submodules?

# Enable submodule summary when viewing git status
git config --local status.submoduleSummary true
# Now git status will give you information on the details of the submodule commits
# You may summarize this in the commit when updating the submodule in the parent.
git status
On branch architecture-changes
Your branch is up to date with 'origin/architecture-changes'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   admin-app (new commits)
	modified:   frontend-app (new commits)

Submodules changed but not updated:

* admin-app 6eb4ab0...c67ff68 (5):
  > fix migration order
  > Upgrade to Rails 7 :v: :diamonds: :gem:
  > Update .gitignore
  > start building out the password change flow
  > WIP: start to move towards using devise tokens

* frontend-app c3a3130...954393d (1):
  > allow for required key in env_Vars

no changes added to commit (use "git add" and/or "git commit -a")

Alternatively if you don't care about the changes and simply want to update do what is recommended in this stackoverflow https://stackoverflow.com/a/44837028/700723 which is to simply update via:

git submodule update --recursive --remote

Then add a message such as Update submodule XXX to latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment