I want to update my submodule on my local machine to the latest revision of the super repository. Currently I h开发者_开发知识库ave
git submodule status
257a40757014ca5a2e8b500d2eb3000cb6628094 common (heads/master)
I tried git submodule update
, but it wasn't even trying to contact the remote machine:
[submodule "common"]
url = ssh://foo.com:22/home/bar/webapps/git/repos/common.git
what's wrong?
You need to make that update from within the submodule.
And then go back one level and commit from the parent repo.
Your git submodule update was just about asking the parent repo to check if the submodule had the content 257a40757
. It had, so no connection was necessary.
Since a submodule is its own git repo, you need to update that repo first, then record the new updated state of said submodule in the parent repo.
You need to cd
in to the submodule directory and run a git pull
first. Then, cd
to your super repository and git add [submodule folder]
to update the ref.
See Git Book - Submodules.
精彩评论