8/31/2023 0 Comments Git submodule add branch example![]() To fetch changes for remotes of the main module and all remotes of the submodules: $ git fetch -all -recurse-submodules UpdateĪfter checking out a branch (or revision) on the main module, you need to update the submodules too: $ git checkout foo_local_branch To clone the main module and all its submodules: $ git clone -recursive prefer to use the normal clone, followed by initializing and updating all submodules: $ git clone git submodule update -init -recursive FetchĮach of the submodules are usually linked to remote repositories (like Github or NFS). When you clone a Git repository that has submodules, the submodules are not cloned. Here are the Git practices and incantations I have found useful to work with submodules: Clone However, sooner or later the complexity that Git exposes will bite back requiring one to revert back to the shell to operate. Many folks use Git clients like SmartGit that make it easy to work with submodules. So, you will need to know how to work with this setup. ![]() However, organization of submodules in this manner are found in many Github repositories. Working with submodules in Git can be a bit confusing and painful, especially when there is a hierarchy of submodules in the main module. This file lists out the external Git repo URLs, the local path inside the repo where they will exist and their given name. ![]() gitmodules file at the root of the repo indicates that this repo uses submodules. This is useful for example, if the current Git repo depends on or requires the source code in other Git repo. Submodules in Git enable you add and manage external Git repos into an existing Git repo. □ 2016-Feb-10 ⬩ ✍️ Ashwin Nanjappa ⬩ □️ git, submodule ⬩ □ Archive ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |