{"id":60562,"date":"2018-09-27T15:00:19","date_gmt":"2018-09-27T12:00:19","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=60562"},"modified":"2019-04-23T14:14:43","modified_gmt":"2019-04-23T11:14:43","slug":"git-orphan-branch-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/","title":{"rendered":"Git Orphan Branch Example"},"content":{"rendered":"<p>In this post, we present a Git Orphan Branch Example.<\/p>\n<h2>1. Introduction<\/h2>\n<p>In general, when you create a new branch off branch \u201cmaster\u201d you inherit its commit history. The exception is an orphan (or disconnected) branch. An orphan branch does not have a parent-child relationship to the master branches\u2019 commits.<\/p>\n<p>Most commits have one parent commit, one obvious exception being root commits which have no parent commits. Creating an orphan branch will retain the working tree of the branch it&#8217;s based on, but without an ancestor commit.<\/p>\n<p>You may want to create an orphan branch to keep the project documentation separate from the code. Or you may want to create an orphan branch if you plan to merge two unrelated repositories with different histories.<\/p>\n<p>Another use case for an creating an orphan branch is to create a static site for project or organizational information directly from a GitHub repository.<\/p>\n<p>In any case, orphan branches are short-term solutions for unconventional situations and are typically discarded after serving their purpose. In this example, we will demonstrate how to create an orphan branch in Git.\n<\/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<p><strong>Note:<\/strong> This example was created on the macOS platform. Git for Windows includes Git Bash and Git CMD shells to run command-line operations.<\/p>\n<h2>2. Git Orphan Branch Example<\/h2>\n<p>Let\u2019s start by changing into the top directory of your local repository and running the Git <code>status<\/code> command.<\/p>\n<pre class=\"brush:bash\">$ cd ebookstore\nGilbertopezsMBP:ebookstore gilbertlopez$ git status\nOn branch master\nYour branch is up-to-date with 'origin\/master'.\nnothing to commit, working tree clean\n<\/pre>\n<p><strong>Note: <\/strong>For the purposes of this example, commit or unstage any staged files before you continue.<\/p>\n<p>Change to the master branch if you are in a different branch.<\/p>\n<pre class=\"brush:bash\">$ git checkout master\nSwitched to branch 'master'\n<\/pre>\n<p>Run the <code>log<\/code> command to view the commit history of the master branch<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git log --oneline\nfcafda0 Added Spring Security dependencies to pom.xml\n945ceee Merge branch 'master' of https:\/\/bitbucket.org\/gilbert_lopez\/ebookstore.git\n9492190 Spring Security SQL script for USERS and Authorities tables.\nc464a25 README updated with Spring Security Database Schema location information.\n5b61da8 README.md edited online with Bitbucket\n53571f6 Added Spring Security using JDBC authentication.\n61d10f2 Added form field validation for Book domain model.\nc8659b8 Moved image file saving functionality to the service layer.\na0fcb77 Added edit\/update function\n215bb63 Added upload file functionality.\nc9e85b0 Check in remaining files.\na791f39 Merge branch 'master' of https:\/\/gilbert_lopez@bitbucket.org\/gilbert_lopez\/ebookstore.git\n92b22b1 README.md created online with Bitbucket\n302bb61 Initial e-Commerce project check-in\n<\/pre>\n<p>The <code>oneline<\/code> option directs the log command to display the commit\u2019s abbreviated hash and message only.<\/p>\n<p>Run the Git <code>ls-files<\/code> command to the view files in the master branch.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git ls-files\nREADME.md\nebookstore\/pom.xml\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/AppConfig.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/AppInitializer.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/HibernateConfig.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/SecurityConfig.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/SecurityInitializer.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/AdminController.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/AppController.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/LoginController.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/AbstractDao.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/BookDao.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/BookDaoImpl.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/model\/Book.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/BookService.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/BookServiceImpl.java\nebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/FileUtil.java\nebookstore\/src\/main\/resources\/application.properties\nebookstore\/src\/main\/resources\/book.sql\nebookstore\/src\/main\/resources\/messages.properties\nebookstore\/src\/main\/resources\/spring_security.sql\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/app.css\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/bootstrap-theme.min.css\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/bootstrap.min.css\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/justified-nav.css\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/main.css\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.eot\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.svg\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.ttf\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.woff\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.woff2\nebookstore\/src\/main\/webapp\/WEB-INF\/resources\/js\/bootstrap.min.js\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/accessDenied.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/addBook.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/admin.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/bookDetail.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/bookInventory.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/books.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/editBook.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/home.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/login.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/templates\/footer.jsp\nebookstore\/src\/main\/webapp\/WEB-INF\/views\/templates\/header.jsp\n<\/pre>\n<p>To create an orphan branch, run the <code>checkout<\/code> command with the &#8216;orphan&#8217; flag and give the branch a name.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:bash\">$ git checkout --orphan myorphanbranch\nSwitched to a new branch 'myorphanbranch'\n<\/pre>\n<p>Now if you run the <code>log<\/code> command, you will get the following output.<\/p>\n<pre class=\"brush:bash\">$ git log --oneline\nfatal: your current branch 'myorphanbranch' does not have any commits yet\n<\/pre>\n<p>This is because orphan branches do not inherit commits from the parent branch. Now run the <code>status<\/code> command.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git status\nOn branch myorphanbranch\n\nInitial commit\n\nChanges to be committed:\n  (use \"git rm --cached ...\" to unstage)\n\n\tnew file:   README.md\n\tnew file:   ebookstore\/pom.xml\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/AppConfig.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/AppInitializer.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/HibernateConfig.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/SecurityConfig.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/SecurityInitializer.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/AdminController.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/AppController.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/LoginController.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/AbstractDao.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/BookDao.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/BookDaoImpl.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/model\/Book.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/BookService.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/BookServiceImpl.java\n\tnew file:   ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/FileUtil.java\n\tnew file:   ebookstore\/src\/main\/resources\/application.properties\n\tnew file:   ebookstore\/src\/main\/resources\/book.sql\n\tnew file:   ebookstore\/src\/main\/resources\/messages.properties\n\tnew file:   ebookstore\/src\/main\/resources\/spring_security.sql\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/app.css\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/bootstrap-theme.min.css\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/bootstrap.min.css\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/justified-nav.css\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/main.css\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.eot\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.svg\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.ttf\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.woff\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.woff2\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/js\/bootstrap.min.js\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/accessDenied.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/addBook.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/admin.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/bookDetail.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/bookInventory.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/books.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/editBook.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/home.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/login.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/templates\/footer.jsp\n\tnew file:   ebookstore\/src\/main\/webapp\/WEB-INF\/views\/templates\/header.jsp\n<\/pre>\n<p>You will notice that although all the files were copied to the orphan branch, they are in the staged area. That is because no commits have been performed thus far in the orphan branch.[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<p>We can remove all files in the working tree with the <code>git rm -rf .<\/code> command.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git rm -rf .\nrm 'README.md'\nrm 'ebookstore\/pom.xml'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/AppConfig.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/AppInitializer.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/HibernateConfig.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/SecurityConfig.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/config\/SecurityInitializer.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/AdminController.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/AppController.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/controller\/LoginController.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/AbstractDao.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/BookDao.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/dao\/BookDaoImpl.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/model\/Book.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/BookService.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/BookServiceImpl.java'\nrm 'ebookstore\/src\/main\/java\/org\/lopez\/ebookstore\/service\/FileUtil.java'\nrm 'ebookstore\/src\/main\/resources\/application.properties'\nrm 'ebookstore\/src\/main\/resources\/book.sql'\nrm 'ebookstore\/src\/main\/resources\/messages.properties'\nrm 'ebookstore\/src\/main\/resources\/spring_security.sql'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/app.css'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/bootstrap-theme.min.css'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/bootstrap.min.css'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/justified-nav.css'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/css\/main.css'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.eot'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.svg'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.ttf'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.woff'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/fonts\/glyphicons-halflings-regular.woff2'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/resources\/js\/bootstrap.min.js'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/accessDenied.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/addBook.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/admin.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/bookDetail.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/bookInventory.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/books.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/editBook.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/home.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/login.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/templates\/footer.jsp'\nrm 'ebookstore\/src\/main\/webapp\/WEB-INF\/views\/templates\/header.jsp'\n<\/pre>\n<p>Now we have a branch with no commits and no files. Run the Git <code>ls-files<\/code> command to the view files in the <em>orphan<\/em> branch. You&#8217;ll notice there are no files in the branch.<\/p>\n<p>Let\u2019s create and add a README file.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ echo \"#My Readme file\" &gt; README.md\n$ git add README.md\n<\/pre>\n<p>Next, we&#8217;ll commit the file.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git commit -a -m \"Initial Commit\"\n[myorphanbranch (root-commit) 92e1465] Initial Commit\n 1 file changed, 1 insertion(+)\n create mode 100644 README.md\n<\/pre>\n<p>Finally, run the log command.<\/p>\n<pre class=\"brush:bash; wrap-lines:false\">$ git log --oneline\n92e1465 Initial Commit\n<\/pre>\n<p>We now have an orphan branch with its own commit history and working tree disparate from the master branch in the repository.<\/p>\n<h2>3. Git Orphan Branch &#8211; Summary<\/h2>\n<p>In this post, we demonstrated how to create an orphan branch in Git. Although orphan branches are not commonly used, they are sometimes handy for writing documentation and creating static GitHub pages. They are also sometimes used to merge two unrelated repositories with different histories.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we present a Git Orphan Branch Example. 1. Introduction In general, when you create a new branch off branch \u201cmaster\u201d you inherit its commit history. The exception is an orphan (or disconnected) branch. An orphan branch does not have a parent-child relationship to the master branches\u2019 commits. Most commits have one parent &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,1535,1508],"class_list":["post-60562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git","tag-git-bash","tag-git-branch"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Orphan Branch Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about Git? Then check out our detailed example on Git Orphan Branch! You can also 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-orphan-branch-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Orphan Branch Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about Git? Then check out our detailed example on Git Orphan Branch! You can also download our FREE Git Tutorial!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-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-09-27T12:00:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-23T11:14:43+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=\"10 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-orphan-branch-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/\"},\"author\":{\"name\":\"Gilbert Lopez\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce\"},\"headline\":\"Git Orphan Branch Example\",\"datePublished\":\"2018-09-27T12:00:19+00:00\",\"dateModified\":\"2019-04-23T11:14:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/\"},\"wordCount\":534,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"git\",\"Git bash\",\"git branch\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/\",\"name\":\"Git Orphan Branch Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2018-09-27T12:00:19+00:00\",\"dateModified\":\"2019-04-23T11:14:43+00:00\",\"description\":\"Interested to learn more about Git? Then check out our detailed example on Git Orphan Branch! You can also download our FREE Git Tutorial!\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-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-orphan-branch-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 Orphan Branch 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 Orphan Branch Example - Java Code Geeks","description":"Interested to learn more about Git? Then check out our detailed example on Git Orphan Branch! You can also 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-orphan-branch-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Orphan Branch Example - Java Code Geeks","og_description":"Interested to learn more about Git? Then check out our detailed example on Git Orphan Branch! You can also download our FREE Git Tutorial!","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-09-27T12:00:19+00:00","article_modified_time":"2019-04-23T11:14:43+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":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/"},"author":{"name":"Gilbert Lopez","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce"},"headline":"Git Orphan Branch Example","datePublished":"2018-09-27T12:00:19+00:00","dateModified":"2019-04-23T11:14:43+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/"},"wordCount":534,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["git","Git bash","git branch"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/","name":"Git Orphan Branch Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2018-09-27T12:00:19+00:00","dateModified":"2019-04-23T11:14:43+00:00","description":"Interested to learn more about Git? Then check out our detailed example on Git Orphan Branch! You can also download our FREE Git Tutorial!","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-orphan-branch-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-orphan-branch-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 Orphan Branch 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\/60562","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=60562"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/60562\/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=60562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=60562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=60562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}