Dan Rosenstark
Dan Rosenstark

Reputation: 69757

Git Submodule: Which commit (hash) do I need?

When I roll back my git working directory to a particular commit, the submodule shows as "modified." The submodule is checked in and has no modified files, but it's at different commit than it needs to be. How can I find out the name/hash of the correct commit?

Upvotes: 1

Views: 833

Answers (1)

redhotvengeance
redhotvengeance

Reputation: 27866

If what you're looking to do is get your submodules to also rollback to their appropriate commits, then try:

git submodule update --recursive

This will update all of your submodules to the commit they should be sitting at (referencing the meta data your parent repo has stored with each commit about what commits its submodules should be at).

Upvotes: 2

Related Questions