{"id":241,"date":"2012-07-12T17:25:45","date_gmt":"2012-07-12T21:25:45","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/acts\/?p=241"},"modified":"2012-07-12T17:25:45","modified_gmt":"2012-07-12T21:25:45","slug":"working-with-submodules","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/acts\/2012\/07\/12\/working-with-submodules\/","title":{"rendered":"Working with Submodules"},"content":{"rendered":"<p>I&#8217;m using <a href=\"http:\/\/blogs.law.harvard.edu\/acts\/2012\/06\/20\/git-template-application-repository\/\" title=\"Git Template Application Repository\">submodules in my current application<\/a>.  All over the place.  And I&#8217;ve hit some issues with using them properly.  Regardless of the warnings I&#8217;ve read about, I still did things in the wrong order.<\/p>\n<p><code><br \/>\ncd .\/subm<br \/>\ngit checkout master<br \/>\ngit commit -a -m \"commit to submodule\"<br \/>\ngit push<br \/>\ncd ..<br \/>\ngit add subm<br \/>\ngit commit -m \"committing submodule's commit to main project\"<br \/>\n<\/code><\/p>\n<p>The thing I&#8217;ve done wrong twice now is committing the change to the main project first.  That creates a link to a nonexistant commit on the submodule as that is what a submodule is, a link to a specific commit on a different project. The  commit has to be done within the submodule first.<\/p>\n<p>Edit: found this after the fact, edited my code to match the code there as it&#8217;s more succinct.  Stackoverflow has everything<br \/>\nhttp:\/\/stackoverflow.com\/questions\/5814319\/git-submodule-push<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using submodules in my current application. All over the place. And I&#8217;ve hit some issues with using them properly. Regardless of the warnings I&#8217;ve read about, I still did things in the wrong order. cd .\/subm git checkout master git commit -a -m &#8220;commit to submodule&#8221; git push cd .. git add subm git [&hellip;]<\/p>\n","protected":false},"author":4571,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63924,3772,63928,63993],"tags":[64000,64002],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-atg","category-git","category-quizmo-atg","category-version-control","tag-github","tag-submodule"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/users\/4571"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":2,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":243,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/241\/revisions\/243"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}