Checking out Git Submodules

I would like to do a partial checkout of a Git repository containing submodules.
Here is what I did to check the directory :

git clone --no-checkout git@github.com:MyOrganization/MyRepo.git --depth 1 --recurse-submodules

then:

  • Changes don't appear in Unstaged changes
  • Accessing Commit Message in git commit-msg on Windows
  • Using Git I have two separate changes I am working on — what is the best way to handle this?
  • Puppet Modules - Best Practices for Installing External Modules and Downloading Packages
  • Is it possible to mark specific file or contents of a specific folder as binary in .gitattributes?
  • How can I pull in changes to a file from a subdirectory in another git repository
  • cd MyRepo
    git checkout HEAD MyDirectory/puppet/
    

    This checkouts MyDirectory/puppet but does’nt retrieve the submodules contained in MyDirectory/puppet/modules directory…

    Any idea how I could checkout the submodules ? If I could do it without having to run same command on every submodules directory that would be great, because modules list is going to change quite frequently.

    Thank you !

  • Switching Git workflow from merge to rebase: how to clean up a merge commit history?
  • Can I hide commits' time when I push to GitHub?
  • Weird message on .git commit with exclamation point
  • How to fix Git submodule resulting in 404 not found..?
  • Breaking up a branch into single file commits
  • How to prevent git pull from overwriting a file?
  • One Solution collect form web for “Checking out Git Submodules”

    try:
    git submodule update --recursive

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