0

How to perform git add path/to/submodule but in a way that will update the staging area to have the submodule set to a specific submodule hash instead of the currently checked out hash?

This would be very useful for me when splitting a bulk of changes into separate PRs.

1 Answer 1

1

You need to checkout that commit in the submodule and then commit it in the superproject:

cd path/to/submodule git checkout $COMMIT_HASH cd ../back/to/superproject git add path/to/submodule git commit -m "Update submodule" 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.