How to update the git submodule?

I have 2 projects. “MyProg” and “SubProj“.
Both projects are on Bitbucket.

One project is submodule to the second. The problem is that when I pull changes in the main project, the changes submodule are not pulled.

Perhaps it should be, or did I do something wrong?
How do I do that when you upgrade one project and pull the second project’s change?

  • $HOME git repo (selectively) to github?
  • How to setup submodule so that git clone --recursive always takes master of submodule
  • Merge upstream repository with a fork that replaced directories with submodules
  • Linking a single file from another git repository
  • How to make submodule with detached HEAD to be attached to actual HEAD?
  • How to nest Git Submodules within Submodules?
  • Git - how to track untracked content?
  • Pushing local repo to remote does not push submodule files using GIT
  • One Solution collect form web for “How to update the git submodule?”

    The problem is that when I pull changes in the main project, the changes submodule not pull

    Don’t forget that a submodule is a fixed reference to a SHA1: it is a gitlink, a special entry in the index.

    It doesn’t move unless you have configured that submodule to follow a branch.
    (See “git submodule tracking latest” and “Git submodule new version update”)
    In that case, this would update it:

    git submodule update --init --remote
    

    Don’t forget to add, commit and push (in the parent repo) the new reference if the submodule was updated to a more recent SHA1.

    Git Baby is a git and github fan, let's start git clone.