http:\/\/nvie.com\/posts\/a-successful-git-branching-model\/<\/a>. Imagine Sub has only one branch named master.<\/p>\nFirst, make sure you don’t override other changes in Sub.<\/strong><\/p>\n\n- Have the latest from develop in your current local branch in the Main and Other repos.<\/li>\n
- Verify in Sub, for both Main and Other repos, that the latest commits on that master branch are being already pointed to.\n
\n- Checkout and Pull the master branch in each copy of Sub.<\/li>\n
- Check your uncommitted changes in Main and Other.<\/li>\n
- You can also check the commits in the main repos to see which commit in Sub each is pointed to.<\/li>\n<\/ol>\n<\/li>\n
- If you have uncommitted changes in either top-level repo, changes in Sub (either on someone\u2019s branch, or in one repo but not the other) have not been updated in develop.\n
\n- Speak to the developer if you have any questions about the changes.<\/li>\n
- Commit and push the Sub changes in each top-level repo if reasonable.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n
Then, make your changes to the submodule.<\/strong><\/p>\n\n- Make your changes into the relevant subdirectory of Sub nested in the Main repo.<\/li>\n
- Commit and push Main’s Sub master changes.<\/li>\n
- Commit and push the Main repo reference change to the latest commit in Sub.<\/li>\n
- Pull the Other’s Sub master changes.<\/li>\n
- Commit and push the Other repo reference change to the latest commit in Sub.<\/li>\n<\/ol>\n
I hope that helps, and as always leave me a comment below if you have any questions.<\/p>\n","protected":false},"excerpt":{"rendered":"
A Git submodule is a nested repository. You might be interested in creating such repository if you have a multiple repos with a shared folder of code. You could copy and paste that code between repos when there is a change, but a shared repo set as a submodule could help keep it in sync. …<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[3],"tags":[],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-git"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6Os38-1k","_links":{"self":[{"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/posts\/82"}],"collection":[{"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":8,"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":90,"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/posts\/82\/revisions\/90"}],"wp:attachment":[{"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/langstonsoftware.com\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}