{"id":36298,"date":"2016-04-21T11:00:18","date_gmt":"2016-04-21T08:00:18","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=36298"},"modified":"2019-04-23T14:53:57","modified_gmt":"2019-04-23T11:53:57","slug":"git-create-branch-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/","title":{"rendered":"Git Create Branch Example"},"content":{"rendered":"<p>In this example we shall learn how to create a branch with Git Version Control tool.<\/p>\n<h2>1. Introduction to Version Control<\/h2>\n<p>Version control is an application that records changes to a file or set of files over time so that one can recall specific versions later. One can see file change history and track changes.<\/p>\n<p>There are three type of version control tools available:<br \/>\n&nbsp;<br \/>\n&nbsp;\n<\/p>\n<h3>1.1 Local Version Control Systems<\/h3>\n<p>Local VCSs has a simple database that keeps all the changes to files under revision control. One of the more popular VCS tools was a system called RCS, which is still distributed with many computers today.<\/p>\n<h3>1.2 Centralized Version Control Systems<\/h3>\n<p>Centralized Version Control Systems (CVCSs) was developed to help developers work in a collaborative manner. These applications, such as CVS, Subversion, have a single server that contains all the versioned files.<\/p>\n<h3>1.3 Distributed Version Control Systems<\/h3>\n<p>In a DVCS (such as Git, Mercurial, Bazaar or Darcs), clients don\u2019t just check out the latest snapshot of the files: <b>they fully mirror the repository<\/b>. Thus if any server crashes, any of the client repositories can be copied back up to the server to restore it.<\/p>\n<h2>2. Introduction to Git<\/h2>\n<p>As we read in previous section Git is one of the available Distributed Version Control Systems.<\/p>\n<p>The major difference between Git and any other VCS is the way Git stores data. In Git, every time one commit, or save the state of project, it basically takes a picture of what all files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn\u2019t store the file again, just a link to the previous identical file it had already stored.<\/p>\n<h2>3. Pre-requisites<\/h2>\n<p>To see this example in action, Git should be installed. It can be downloaded from <a href=\"https:\/\/git-scm.com\/\">here<\/a>.<\/p>\n<h2>4. Creating branch on Git<\/h2>\n<p>Git branches aren&#8217;t like SVN branches which most of us use. The main purpose of SVN branches is to capture large-scale development effort which is again very occasional. On the other hand, Git branches are an integral part of one&#8217;s everyday workflow.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>A Git branch represents an independent line of development and this serve as an abstraction for the edit\/stage\/commit process.&nbsp;One can think of them as a way to request a brand new working directory, staging area, and project history. And all the new commits are recorded in the history for the current branch.<\/p>\n<p>The <code>git branch<\/code> command helps in creating, listing, renaming, and deleting of branches.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Usage:<\/em><\/span><\/p>\n<p>First let&#8217;s create a new directory where we shall create the <i>master<\/i> branch.<\/p>\n<p><figure id=\"attachment_36399\" aria-describedby=\"caption-attachment-36399\" style=\"width: 624px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-Directory.jpg\" rel=\"attachment wp-att-36399\"><img decoding=\"async\" class=\"size-full wp-image-36399\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-Directory.jpg\" alt=\"Create Directory for initializing master branch\" width=\"624\" height=\"287\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-Directory.jpg 624w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-Directory-300x138.jpg 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/a><figcaption id=\"caption-attachment-36399\" class=\"wp-caption-text\">Create Directory for initializing master branch<\/figcaption><\/figure><\/p>\n<p>Now, we shall initialize our master branch with <code>git init<\/code> command.<\/p>\n<p><figure id=\"attachment_36400\" aria-describedby=\"caption-attachment-36400\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Init-Branch.jpg\" rel=\"attachment wp-att-36400\"><img decoding=\"async\" class=\"size-full wp-image-36400\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Init-Branch.jpg\" alt=\"Initilize master branch\" width=\"660\" height=\"234\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Init-Branch.jpg 660w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Init-Branch-300x106.jpg 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><figcaption id=\"caption-attachment-36400\" class=\"wp-caption-text\">Initilize master branch<\/figcaption><\/figure><\/p>\n<p>Next step we shall add some files to the master branch and shall commit the same.<\/p>\n<p><figure id=\"attachment_36401\" aria-describedby=\"caption-attachment-36401\" style=\"width: 620px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Add-file-to-Git-Repository.jpg\" rel=\"attachment wp-att-36401\"><img decoding=\"async\" class=\"size-full wp-image-36401\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Add-file-to-Git-Repository.jpg\" alt=\"Add file to Git Repository and Commit\" width=\"620\" height=\"266\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Add-file-to-Git-Repository.jpg 620w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Add-file-to-Git-Repository-300x129.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><figcaption id=\"caption-attachment-36401\" class=\"wp-caption-text\">Add file to Git Repository and Commit<\/figcaption><\/figure>[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<p>Now we shall create a new dir for our branch.<\/p>\n<p><figure id=\"attachment_36402\" aria-describedby=\"caption-attachment-36402\" style=\"width: 604px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-dir-for-Branch.jpg\" rel=\"attachment wp-att-36402\"><img decoding=\"async\" class=\"size-full wp-image-36402\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-dir-for-Branch.jpg\" alt=\"Create dir for Branch\" width=\"604\" height=\"240\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-dir-for-Branch.jpg 604w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Create-dir-for-Branch-300x119.jpg 300w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/a><figcaption id=\"caption-attachment-36402\" class=\"wp-caption-text\">Create dir for Branch<\/figcaption><\/figure><\/p>\n<p>And after we have created a directory, we shall clone the original <i>master<\/i> branch into this directory. This shall be done using <code>git clone<\/code> command.<\/p>\n<p><figure id=\"attachment_36403\" aria-describedby=\"caption-attachment-36403\" style=\"width: 749px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Clone-master-branch.jpg\" rel=\"attachment wp-att-36403\"><img decoding=\"async\" class=\"size-full wp-image-36403\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Clone-master-branch.jpg\" alt=\"Clone master branch\" width=\"749\" height=\"277\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Clone-master-branch.jpg 749w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Clone-master-branch-300x111.jpg 300w\" sizes=\"(max-width: 749px) 100vw, 749px\" \/><\/a><figcaption id=\"caption-attachment-36403\" class=\"wp-caption-text\">Clone master branch<\/figcaption><\/figure><\/p>\n<p>Now we shall use command <code>git branch<\/code> to see the available branches.<\/p>\n<p><figure id=\"attachment_36404\" aria-describedby=\"caption-attachment-36404\" style=\"width: 746px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/git-branch.jpg\" rel=\"attachment wp-att-36404\"><img decoding=\"async\" class=\"size-full wp-image-36404\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/git-branch.jpg\" alt=\"git branch command\" width=\"746\" height=\"333\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/git-branch.jpg 746w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/git-branch-300x134.jpg 300w\" sizes=\"(max-width: 746px) 100vw, 746px\" \/><\/a><figcaption id=\"caption-attachment-36404\" class=\"wp-caption-text\">git branch command<\/figcaption><\/figure><\/p>\n<p>Next we shall create branch using command <code>git branch &lt;branch name&gt;<\/code>.<\/p>\n<p><figure id=\"attachment_36405\" aria-describedby=\"caption-attachment-36405\" style=\"width: 749px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/create-git-branch.jpg\" rel=\"attachment wp-att-36405\"><img decoding=\"async\" class=\"size-full wp-image-36405\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/create-git-branch.jpg\" alt=\"create git branch\" width=\"749\" height=\"356\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/create-git-branch.jpg 749w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/create-git-branch-300x143.jpg 300w\" sizes=\"(max-width: 749px) 100vw, 749px\" \/><\/a><figcaption id=\"caption-attachment-36405\" class=\"wp-caption-text\">create git branch<\/figcaption><\/figure><\/p>\n<p>And at last, now that we have created branch we shall be switching to the branch using command <code>git checkout<\/code>.<\/p>\n<p><figure id=\"attachment_36406\" aria-describedby=\"caption-attachment-36406\" style=\"width: 747px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Switch-to-git-branch.jpg\" rel=\"attachment wp-att-36406\"><img decoding=\"async\" class=\"size-full wp-image-36406\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Switch-to-git-branch.jpg\" alt=\"Switch to git branch\" width=\"747\" height=\"404\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Switch-to-git-branch.jpg 747w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/Switch-to-git-branch-300x162.jpg 300w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/a><figcaption id=\"caption-attachment-36406\" class=\"wp-caption-text\">Switch to git branch<\/figcaption><\/figure><\/p>\n<h2>5. Conclusion<\/h2>\n<p>In this example, we learnt basics of <code>git branch<\/code> command and how to create git branches.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this example we shall learn how to create a branch with Git Version Control tool. 1. Introduction to Version Control Version control is an application that records changes to a file or set of files over time so that one can recall specific versions later. One can see file change history and track changes. &hellip;<\/p>\n","protected":false},"author":75,"featured_media":27377,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1353],"tags":[1454,1452,1453],"class_list":["post-36298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-distributed-version-control","tag-git-create","tag-version-control"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Create Branch Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example we shall learn how to create a branch with Git Version Control tool. 1. Introduction to Version Control Version control is an application\" \/>\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-create-branch-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Create Branch Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example we shall learn how to create a branch with Git Version Control tool. 1. Introduction to Version Control Version control is an application\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-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=\"2016-04-21T08:00:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-23T11:53:57+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=\"Saurabh Arora\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Saurabh Arora\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 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-create-branch-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/\"},\"author\":{\"name\":\"Saurabh Arora\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5bf4e0274824642c44536b83ddbfaf6c\"},\"headline\":\"Git Create Branch Example\",\"datePublished\":\"2016-04-21T08:00:18+00:00\",\"dateModified\":\"2019-04-23T11:53:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/\"},\"wordCount\":637,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"distributed version control\",\"git create\",\"version control\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/\",\"name\":\"Git Create Branch Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2016-04-21T08:00:18+00:00\",\"dateModified\":\"2019-04-23T11:53:57+00:00\",\"description\":\"In this example we shall learn how to create a branch with Git Version Control tool. 1. Introduction to Version Control Version control is an application\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-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-create-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 Create 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\/5bf4e0274824642c44536b83ddbfaf6c\",\"name\":\"Saurabh Arora\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Saurabh-Arora-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Saurabh-Arora-96x96.jpg\",\"caption\":\"Saurabh Arora\"},\"description\":\"Saurabh graduated with an engineering degree in Information Technology from YMCA Institute of Engineering, India. He is SCJP, OCWCD certified and currently working as Technical Lead with one of the biggest service based firms and is involved in projects extensively using Java and JEE technologies. He has worked in E-Commerce, Banking and Telecom domain.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\",\"https:\/\/in.linkedin.com\/in\/saurabh-arora-78674b18\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/saurabh-arora\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Create Branch Example - Java Code Geeks","description":"In this example we shall learn how to create a branch with Git Version Control tool. 1. Introduction to Version Control Version control is an application","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-create-branch-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Create Branch Example - Java Code Geeks","og_description":"In this example we shall learn how to create a branch with Git Version Control tool. 1. Introduction to Version Control Version control is an application","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-04-21T08:00:18+00:00","article_modified_time":"2019-04-23T11:53:57+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":"Saurabh Arora","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Saurabh Arora","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/"},"author":{"name":"Saurabh Arora","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5bf4e0274824642c44536b83ddbfaf6c"},"headline":"Git Create Branch Example","datePublished":"2016-04-21T08:00:18+00:00","dateModified":"2019-04-23T11:53:57+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/"},"wordCount":637,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["distributed version control","git create","version control"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/","name":"Git Create Branch Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2016-04-21T08:00:18+00:00","dateModified":"2019-04-23T11:53:57+00:00","description":"In this example we shall learn how to create a branch with Git Version Control tool. 1. Introduction to Version Control Version control is an application","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-branch-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-create-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-create-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 Create 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\/5bf4e0274824642c44536b83ddbfaf6c","name":"Saurabh Arora","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Saurabh-Arora-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Saurabh-Arora-96x96.jpg","caption":"Saurabh Arora"},"description":"Saurabh graduated with an engineering degree in Information Technology from YMCA Institute of Engineering, India. He is SCJP, OCWCD certified and currently working as Technical Lead with one of the biggest service based firms and is involved in projects extensively using Java and JEE technologies. He has worked in E-Commerce, Banking and Telecom domain.","sameAs":["http:\/\/www.javacodegeeks.com\/","https:\/\/in.linkedin.com\/in\/saurabh-arora-78674b18"],"url":"https:\/\/examples.javacodegeeks.com\/author\/saurabh-arora\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/36298","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\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=36298"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/36298\/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=36298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=36298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=36298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}