![]() ![]() git submodule update -init -recursive For git 1.8. You can also change the commit that is checked out in each submodule by performing a checkout in the submodule repository and then committing the change in the parent repository. If it's the first time you check-out a repo you need to use -init first. This was done to make it less likely we will get accidental commits on the. Then, another developer who wants to have submoduledirectory changed to that tag, does this. ![]() This value controls the behavior of the git submodule update command. git add submoduledirectory git commit -m 'moved submodule to v1.0' git push. Get the update rule that will be used for the submodule. This is common when you are experimenting with different checked out branches or tags in the submodule and you want to restore it back to the commit tracked by the parent repository. 13 hours ago &0183 &32 My company acquired a Drupal website with a complicated build process, using dozens of submodules. You may also note that the URLs used for the submodules use the old git:// protocol. If you want to move the submodule to a particular tag: cd submoduledirectory git checkout v1.0 cd. Only then will you get pending changes in the parent repo with updated revision hashes for submodules. Performing a submodule update is also useful when you want to restore your submodule’s repository to the current commit tracked by the parent repository. Submodules are Git repositories nested inside a parent Git repository at a specific path in the parent repositorys working directory. git submodule foreach git pull origin master or git pull origin master -recurse-submodules is what you want if you intend to update each submodule to the latest from their origin repositories. To grasp the concept of working with two repositories, lets get. ![]() we have repositories within the repository). You would then fetch the latest changes in the submodule’s Git repository and perform a submodule update to check out the current revision referenced in the parent repository. Git submodules rely on nesting repositories (i.e. You commonly perform this task after you pull a change in the parent repository that updates the revision checked out in the submodule. Performing a submodule update checks out that specific revision in the submodule’s Git repository. In this case the Git parent repository tracks the commit that should be checked out in each configured submodule. This GitPro page does summarize the consequence of a git submodule update nicely. Alternatively to the tracking of a branch, you can also control which commit of the submodule should be used. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |