git submodule tracking latest

Edit (2020.12.28): GitHub change default master branch to main branch since October 2020. See https://github.com/github/renaming This answer below still reflect the old naming convention. Update March 2013 Git 1.8.2 added the possibility to track branches. “git submodule” started learning a new mode to integrate with the tip of the remote branch (as opposed to integrating … Read more

Git submodule update

This GitPro page does summarize the consequence of a git submodule update nicely When you run git submodule update, it checks out the specific version of the project, but not within a branch. This is called having a detached head — it means the HEAD file points directly to a commit, not to a symbolic … Read more

Easy way to pull latest of all git submodules

If it’s the first time you check-out a repo you need to use –init first: git submodule update –init –recursive For git 1.8.2 or above, the option –remote was added to support updating to latest tips of remote branches: git submodule update –recursive –remote This has the added benefit of respecting any “non default” branches … Read more

How to “git clone” including submodules?

With version 2.13 of Git and later, –recurse-submodules can be used instead of –recursive: git clone –recurse-submodules -j8 git://github.com/foo/bar.git cd bar Editor’s note: -j8 is an optional performance optimization that became available in version 2.8, and fetches up to 8 submodules at a time in parallel — see man git-clone. With version 1.9 of Git … Read more