

Repository, the presumption is the superproject and submodule repositories will be If the URL is given relative to the superproject’s gitmodules for use by subsequent usersĬloning the superproject. In either case, the given URL is recorded into. Submodule from scratch, and presumes the user will later push the submodule to the This second form is provided to ease creating a new If does exist and is already a valid Git repository, then this is added to theĬhangeset without cloning. If does not exist, then the submodule is created by cloning from the named URL. is the relative location for the cloned submodule to exist in the superproject. Is its own authoritative upstream and the current working directory is used instead. If the superproject doesn’t have an origin configured the superproject because the evaluation of relative URLs in Git is identical to that of relativeĭirectories). foo.git - as one might expect when following the rules for relative URLs Which is located right next to a superproject bar.git, you’ll have to use. Superproject’s origin repository (Please note that to specify a repository foo.git This may be eitherĪn absolute URL, or (if it begins with. is the URL of the new submodule’s origin repository. Submodule’s logical name in its configuration entries unless -name is used to specify "/path/to/repo.git" and "foo" for "host.xz:foo/.git"). Not given, the "humanish" part of the source repository is used ("repo" for Relative location for the cloned submodule to exist in the superproject. Directories that come fromīoth projects can be cloned and checked out as a whole if you choose to go that route.Īdd the given repository as a submodule at the given path to the changeset to beĬommitted next to the current project: the current project is termed the Strategy, instead of treating the other project as a submodule. To merge the project histories and want to treat the aggregated whole as a single projectįrom then on, you may want to add a remote for the other project and use the subtree merge You cannot modify the contents of the submodule from within the main project. Source tree, while the history of the two projects still stays completely independent and Project submodules are meant for different projects you would like to make part of your


Submodules are not to be confused with remotes, which are other repositories of the same Local repository configuration (see submodule init). The logical name can be used for overriding this URL within your Tree assigns a logical name to the submodule and describes the default URL the submodule gitmodules (see gitmodules(5)) file at the root of the source Refers to a particular commit object within the inner repository that is completely Submodules are composed from a so-called gitlink tree entry in the main repository that Out and at appropriate revision in your working tree.
#Update git submodule to latest commit update#
When cloning or pulling a repository containing submodules however, these will not beĬhecked out by default the init and update subcommands will maintain submodules checked

This can be used to have external dependencies such as The other repository has its own history, which does not interfere with the Inspects, updates and manages submodules.Ī submodule allows you to keep another Git repository in a subdirectory of your Git-submodule - Initialize, update or inspect submodules
