ritedopa.blogg.se

Git submodule usage
Git submodule usage














Git submodule usage update#

When you are inside the submodule, you can treat it just like a normal repo, and when you are in the parent repository, you can "add" to change the current commit pointer.īut the traditional downside is that you either have to have your users know git submodule commands, so they can init and update the repo, or they have to add -recursive when they initially clone your repo. git-submodule will correctly locate the submodule using the.

git submodule usage

If the URL is given relative to the superproject’s repository, the presumption is the superproject and submodule repositories will be kept together in the same relative location, and only the superproject’s URL needs to be provided. As noted above, this will also make Git recurse into submodules for every command that has a -recurse-submodules option (except git clone ). gitmodules for use by subsequent users cloning the superproject. The relative path to the repo is important it allows you to keep the same access method (ssh or https) as the parent repository. Luckily, you can tell Git (>2.14) to always use the -recurse-submodules flag by setting the configuration option submodule.recurse: git config submodule.recurse true.

git submodule usage Let’s have a look at the status of our main project, now that we’ve added the submodule: git status On branch master Changes to be committed: (use git restore staged to unstage) new file.

resultant hash can be compared to the currently preserved ref (state) of. automation to capture a known good point of the submodule and then the. We now have the same version of the Submodule checked out that our teammate had committed to the repository. By providing a path like in the example above, however, you can address just a certain Submodule.

git submodule usage

git rev-parse can be used on a HEAD or labeled build in another phase of. In most cases, you can use the 'git submodule' family of commands without specifying a particular Submodule. If you want to add a Git repository on the same service (GitHub, GitLab, BitBucket, etc), the following is the correct Git command to set that up as a submodule in the extern directory: gitbook $ git submodule add. Either use the proper Git commands or a desktop GUI for Git like Tower, which takes care of these details for you. consumed submodule and comparing it to another known state.














Git submodule usage