{"id":61907,"date":"2018-12-07T11:00:33","date_gmt":"2018-12-07T09:00:33","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=61907"},"modified":"2019-04-23T14:14:00","modified_gmt":"2019-04-23T11:14:00","slug":"git-add-submodule-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/","title":{"rendered":"Git Add Submodule Example"},"content":{"rendered":"<p>In this post, we feature a comprehensive Example on Git Add Submodule.<\/p>\n<h2>1. Introduction<\/h2>\n<p>An important concept in software development is reusability. When working on a software project you may have situations where a function or method is used in many places of an application. Rather than interspersing the function\/method code throughout the application, it is useful to place it in a utility class. In a large project where you have many such classes, you may want to move them to a separate project.<\/p>\n<p>If your codebase becomes very large, you may also want to consider creating subprojects. There are advantages to breaking up a large project into smaller projects. For example:<\/p>\n<ul>\n<li>Smaller projects allow for easier code maintenance.<\/li>\n<li>Child projects can be used in other parent projects, encouraging reuse.<\/li>\n<li>The developer or developers can focus on a specific area of the business solution.<\/li>\n<\/ul>\n<p>\n&nbsp;<br \/>\nLet\u2019s assume that these separate projects have their own Git repositories. How can you use the utility project within the main project? In Git, you can include the utility project by adding it as a submodule to the main project.<\/p>\n<p>A submodule is a repository that is contained inside a subdirectory of another repository. Logically, it can be thought of child project of a parent project. Git tracking for the submodule is managed separately from that of the main project. Code that is developed by a 3rd party is often included as a submodule in Git. Themes and plugins in WordPress too are typically included as submodules when Git is used as the Version Control System.<\/p>\n<p>In Git you can add, clone, update and remove submodules within the main project. In this example, we will demonstrate how to add a repository as a submodule of another repository.<\/p>\n<h3>1.1 Tools Used in this Example<\/h3>\n<ul>\n<li>Git 2.17<\/li>\n<\/ul>\n<p>Git downloads are available here: <a href=\"https:\/\/git-scm.com\/downloads\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/git-scm.com\/downloads<\/a>.<\/p>\n<h2>2. Git Add Submodule Example<\/h2>\n<p>In this example, we will create a local repository that contains a utility class. We will then add the new repository as a submodule of an existing main project.<\/p>\n<h3>2.1 Download and Extract the Sample Project<\/h3>\n<p>First, download the &#8220;Submodule Demo&#8221; archive from the <a href=\"#download\">Download<\/a> section and extract it in a directory of your choice.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ ls -R\n.:\ndemo\/  ioutils\/\n\n.\/demo:\nmvnw*  mvnw.cmd  pom.xml  src\/\n\n.\/demo\/src:\nmain\/  test\/\n\n.\/demo\/src\/main:\njava\/  resources\/\n\n.\/demo\/src\/main\/java:\ncom\/\n\n.\/demo\/src\/main\/java\/com:\njavacodegeeks\/\n\n.\/demo\/src\/main\/java\/com\/javacodegeeks:\nexample\/\n\n.\/demo\/src\/main\/java\/com\/javacodegeeks\/example:\ndemo\/\n\n.\/demo\/src\/main\/java\/com\/javacodegeeks\/example\/demo:\nDemoApplication.java\n\n.\/demo\/src\/main\/resources:\napplication.properties\n\n.\/demo\/src\/test:\njava\/\n\n.\/demo\/src\/test\/java:\ncom\/\n\n.\/demo\/src\/test\/java\/com:\njavacodegeeks\/\n\n.\/demo\/src\/test\/java\/com\/javacodegeeks:\nexample\/\n\n.\/demo\/src\/test\/java\/com\/javacodegeeks\/example:\ndemo\/\n\n.\/demo\/src\/test\/java\/com\/javacodegeeks\/example\/demo:\nDemoApplicationTests.java\n\n.\/ioutils:\nFileUtil.java\n<\/pre>\n<p>We have a main project (named &#8220;demo&#8221;) that is tracked in a local repository. If you view the Git config file, you will see configuration information for the main project.<\/p>\n<pre class=\"brush:bash\">$ cat .git\/config\n[core]\n        repositoryformatversion = 0\n        filemode = false\n        bare = false\n        logallrefupdates = true\n        symlinks = false\n        ignorecase = true\n\n<\/pre>\n<p>Let us suppose that the &#8220;demo&#8221; project uses file input\/output operations. Let us further assume that these operations are used in many places within the application. With these points in mind, we created a utility class for those operations and placed it into its own project named &#8220;ioutils&#8221;. We&#8217;ll add the &#8220;ioutils&#8221; project to its own local Git repository next.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3>2.2 Create a Local Repository<\/h3>\n<p>Open a terminal (shell) in the &#8220;ioutils&#8221; directory where the archive was extracted and run the following command:<\/p>\n<pre class=\"brush:bash\">$ git init<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>Git init Command Output<\/em><\/span><\/p>\n<pre class=\"brush:bash; wrap-lines:false\">Initialized empty Git repository in \/Users\/gilbertlopez\/ioutils\/.git\/\n<\/pre>\n<p>This creates an empty Git repository. The repository metadata has been generated in the \u201c.git\u201d folder.<\/p>\n<p>(<strong>Note:<\/strong> This folder is hidden by default as you would, typically, not edit its contents.)<\/p>\n<h3>2.3 Add and Commit the File to the Project Repository<\/h3>\n<p>Let\u2019s add the file to the repository. Run the following command:<\/p>\n<pre class=\"brush:bash\">$ git add FileUtil.java<\/pre>\n<p>This will add the <code>FileUtil.java<\/code> file to the repository index. The file is now in the staging area.<\/p>\n<p>Commit the file from the staging area to the repository with the following command:<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git commit -m 'Initial commit of project'<\/pre>\n<p><strong>Note:<\/strong> The -m option allows us to add a commit message inline.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Git commit Command Output<\/em><\/span><\/p>\n<pre class=\"brush:bash; wrap-lines:false\">[master (root-commit) 45e1f63] initial commit\n 1 file changed, 49 insertions(+)\n create mode 100644 FileUtil.java<\/pre>\n<h3>2.4 Add a Submodule to the Main Project<\/h3>\n<p>Now that we have our utility class in its own Git repository, let&#8217;s add it as a submodule to the &#8220;demo&#8221; project. Run the following command:<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">git submodule add -f ..\/ioutils src\/main\/java\/com\/javacodegeeks\/example\/ioutils<\/pre>\n<p><strong>Note:<\/strong> The -f option is used to force the creation of <code>src\/main\/java\/com\/javacodegeeks\/example\/ioutils<\/code>, the directory where we want the submodule to reside.<\/p>\n<ul>\n<li>The first parameter (..\/ioutils) to the <code>submodule add<\/code> command specifies the location of the repository to be added as a submodule. This could be a local repository (&#8220;ioutils&#8221; in this example) or a remote repository, e.g. https:\/\/github.com\/gilbertlopez\/example.git. It probably goes without saying that you need to be able to clone the repository in order to add it as a submodule.<\/li>\n<li>The second parameter (src\/main\/java\/com\/javacodegeeks\/example\/ioutils) specifies the subdirectory path of the main project where you want the <code>ioutils <\/code>repository to be integrated. If you omit this parameter, Git will add the subproject to directory named the same as the repository (in this case, &#8220;ioutils&#8221;).<\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline;\"><em>Git Submodule Add Command Output<\/em><\/span><\/p>\n<pre class=\"brush:bash; wrap-lines:false\">Cloning into 'C:\/Users\/Gilbert\/gittest\/demo\/src\/main\/java\/com\/javacodegeeks\/example\/ioutils'...\ndone.\nwarning: LF will be replaced by CRLF in .gitmodules.\nThe file will have its original line endings in your working directory.\n<\/pre>\n<p>The <code>add submodule<\/code> command registered the <code>ioutils <\/code>repository within the main project repository&#8217;s configuration. It also cloned the repository into the <code>\/src\/main\/java\/com\/javacodegeeks\/example\/ioutils<\/code> directory.<\/p>\n<p>If you view the Git config file for the main project after running the <code>submodule add<\/code> command, you will notice an additional section.<\/p>\n<pre class=\"brush:bash\">$ cat .git\/config\n[core]\n        repositoryformatversion = 0\n        filemode = false\n        bare = false\n        logallrefupdates = true\n        symlinks = false\n        ignorecase = true\n[submodule \"src\/main\/java\/com\/javacodegeeks\/example\/ioutils\"]\n        url = C:\/Users\/Gilbert\/gittest\/ioutils\n        active = true\n<\/pre>\n<p>This submodule is identified by the path where the <code>ioutils <\/code>repository resides. The \u2018url\u2019 value in the submodule section shows the repository URL link (or directory path for a local repository) of the submodule that Git uses to clone the project.[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<p>Next, check the status of the main project with the following command:<\/p>\n<pre class=\"brush:bash\">$ git status<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>Git status Command Output<\/em><\/span><\/p>\n<pre class=\"brush:bash; wrap-lines:false\">On branch master\nChanges to be committed:\n  (use \"git reset HEAD ...\" to unstage)\n\n        new file:   .gitmodules\n        new file:   src\/main\/java\/com\/javacodegeeks\/example\/ioutils\n<\/pre>\n<p>The <code>submodule add<\/code> command staged two new files: &#8220;.gitmodules&#8221; and &#8220;src\/main\/java\/com\/javacodegeeks\/example\/ioutils&#8221;. (Submodule directories and their contents appear as a single file when viewed by the main project&#8217;s Git repository.) If you look in the <code>ioutils <\/code>subdirectory of the main project, you will see that <code>FileUtil.java<\/code> from the &#8220;ioutils&#8221; repository was cloned into that location.<\/p>\n<p>It is important to note that main and submodule repositories track independently of each other. Go to the submodule\u2019s directory (&#8220;src\/main\/java\/com\/javacodegeeks\/example\/ioutils&#8221;) and run the Git status command:<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git status\nOn branch master\nYour branch is up to date with 'origin\/master'.\n\nnothing to commit, working tree clean\n<\/pre>\n<p>As you can see, the submodule\u2019s Git is unaware of any changes made to the main project.<\/p>\n<p>The Git status for the main project provides some basic information about the staged files. You can get additional information by making the status command submodule-aware. Navigate back to the &#8216;demo&#8217; directory and run the following command:<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git config --global status.submoduleSummary true<\/pre>\n<p>Now run the Git status command again.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git status\nOn branch master\nChanges to be committed:\n  (use \"git reset HEAD ...\" to unstage)\n\n\tnew file:   .gitmodules\n\tnew file:   src\/main\/java\/com\/javacodegeeks\/example\/ioutils\n\nSubmodule changes to be committed:\n\n* src\/main\/java\/com\/javacodegeeks\/example\/ioutils 0000000...a3255ca (1):\n  &gt; Initial commit\n<\/pre>\n<p>The status now shows that the remote repository has 1 commit and that the commit was an addition with the commit message &#8216;Initial commit&#8217;.<\/p>\n<p>To commit the files from the staging area to the repository, run the following command:<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git commit -m 'Added ioutils submodule'<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>Git commit Command Output<\/em><\/span><\/p>\n<pre class=\"brush:bash; wrap-lines:false\">[master 992ad34] Added ioutils submodule\n 2 files changed, 4 insertions(+)\n create mode 100644 .gitmodules\n create mode 160000 src\/main\/java\/com\/javacodegeeks\/example\/ioutils\n<\/pre>\n<h3>2.5 View the .gitmodules File<\/h3>\n<p>Let&#8217;s take a look at the .gitmodules file.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ cat .gitmodules\n[submodule \"src\/main\/java\/com\/javacodegeeks\/example\/ioutils\"]\n        path = src\/main\/java\/com\/javacodegeeks\/example\/ioutils\n        url = ..\/ioutils\n<\/pre>\n<p>The .gitmodules file holds all the submodule configuration information for this project. The data contained in this file is read by Git when anyone clones our project. It is used to locate the submodule repository (<em>url = ..\/ioutils<\/em>) and to specify the subdirectory of the main project where the submodule will be integrated (<em>path = src\/main\/java\/com\/javacodegeeks\/example\/ioutils<\/em>).<\/p>\n<h3>2.6 View the Status of Submodules<\/h3>\n<p>If you simply want to see the locations of your submodules, use the following command:<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git submodule status<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>Git submodule status Command Output<\/em><\/span><\/p>\n<pre class=\"brush:bash; wrap-lines:false\"> e51bafee08eff11e55817d789d40fe96a216c4a7 src\/main\/java\/com\/javacodegeeks\/example\/ioutils (heads\/master)\n<\/pre>\n<p>The output displays the SHA-1 of the currently checked out commit for each submodule in the main project and the path locations where the submodules reside. (In our example, there is only one submodule.)<\/p>\n<h2>3. Summary<\/h2>\n<p>Adding submodules is a great way of integrating other Git repositories to your main project, whether these repositories are from a 3rd party or projects you created yourself for reuse.<\/p>\n<h2><a name=\"download\"><\/a>4. Download the Source Code<\/h2>\n<p>That was Git Add Submodule Example.<\/p>\n<div class=\"download\">\n<strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/12\/Submodule-Demo.zip\"><strong>Submodule Demo<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we feature a comprehensive Example on Git Add Submodule. 1. Introduction An important concept in software development is reusability. When working on a software project you may have situations where a function or method is used in many places of an application. Rather than interspersing the function\/method code throughout the application, it &hellip;<\/p>\n","protected":false},"author":121,"featured_media":27377,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1353],"tags":[1203,1473,1740],"class_list":["post-61907","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git","tag-git-repo","tag-git-submodule"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Add Submodule Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about Git? Then check out our detailed example on Git Add Submodule! Download our FREE Git Tutorial!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Add Submodule Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about Git? Then check out our detailed example on Git Add Submodule! Download our FREE Git Tutorial!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-07T09:00:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-23T11:14:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gilbert Lopez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gillopez_dev\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gilbert Lopez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/\"},\"author\":{\"name\":\"Gilbert Lopez\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce\"},\"headline\":\"Git Add Submodule Example\",\"datePublished\":\"2018-12-07T09:00:33+00:00\",\"dateModified\":\"2019-04-23T11:14:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/\"},\"wordCount\":1240,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"git\",\"Git repo\",\"Git submodule\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/\",\"name\":\"Git Add Submodule Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2018-12-07T09:00:33+00:00\",\"dateModified\":\"2019-04-23T11:14:00+00:00\",\"description\":\"Interested to learn more about Git? Then check out our detailed example on Git Add Submodule! Download our FREE Git Tutorial!\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Git\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Git Add Submodule Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce\",\"name\":\"Gilbert Lopez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg\",\"caption\":\"Gilbert Lopez\"},\"description\":\"Gilbert Lopez is an application developer and systems integration developer with experience building business solutions for large and medium-sized companies. He has worked on many Java EE projects. His roles have included lead developer, systems analyst, business analyst and consultant. Gilbert graduated from California State University in Los Angeles with a Bachelor of Science degree in Business.\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\",\"https:\/\/www.linkedin.com\/in\/gilbertlopezdeveloper\",\"https:\/\/x.com\/gillopez_dev\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/gilbert-lopez\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Add Submodule Example - Java Code Geeks","description":"Interested to learn more about Git? Then check out our detailed example on Git Add Submodule! Download our FREE Git Tutorial!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Add Submodule Example - Java Code Geeks","og_description":"Interested to learn more about Git? Then check out our detailed example on Git Add Submodule! Download our FREE Git Tutorial!","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-12-07T09:00:33+00:00","article_modified_time":"2019-04-23T11:14:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","type":"image\/jpeg"}],"author":"Gilbert Lopez","twitter_card":"summary_large_image","twitter_creator":"@gillopez_dev","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Gilbert Lopez","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/"},"author":{"name":"Gilbert Lopez","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce"},"headline":"Git Add Submodule Example","datePublished":"2018-12-07T09:00:33+00:00","dateModified":"2019-04-23T11:14:00+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/"},"wordCount":1240,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["git","Git repo","Git submodule"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/","name":"Git Add Submodule Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2018-12-07T09:00:33+00:00","dateModified":"2019-04-23T11:14:00+00:00","description":"Interested to learn more about Git? Then check out our detailed example on Git Add Submodule! Download our FREE Git Tutorial!","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-add-submodule-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/"},{"@type":"ListItem","position":3,"name":"Git","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/"},{"@type":"ListItem","position":4,"name":"Git Add Submodule Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce","name":"Gilbert Lopez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg","caption":"Gilbert Lopez"},"description":"Gilbert Lopez is an application developer and systems integration developer with experience building business solutions for large and medium-sized companies. He has worked on many Java EE projects. His roles have included lead developer, systems analyst, business analyst and consultant. Gilbert graduated from California State University in Los Angeles with a Bachelor of Science degree in Business.","sameAs":["https:\/\/www.javacodegeeks.com","https:\/\/www.linkedin.com\/in\/gilbertlopezdeveloper","https:\/\/x.com\/gillopez_dev"],"url":"https:\/\/examples.javacodegeeks.com\/author\/gilbert-lopez\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/61907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/121"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=61907"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/61907\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/27377"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=61907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=61907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=61907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}