{"id":36421,"date":"2016-04-25T15:00:18","date_gmt":"2016-04-25T12:00:18","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=36421"},"modified":"2019-04-23T14:52:48","modified_gmt":"2019-04-23T11:52:48","slug":"git-rename-branch-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/","title":{"rendered":"Git Rename Branch Example"},"content":{"rendered":"<p>In this example we shall learn how to rename a <i>Git<\/i> branch.<\/p>\n<h2>1. 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>2. Git Branch<\/h2>\n<p>Git branches aren\u2019t 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\u2019s everyday workflow.<\/p>\n<p>A Git branch represents an independent line of development and this serve as an abstraction for the edit\/stage\/commit process. 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>In lehman&#8217;s terms, purpose of creating is to keep master branch clean, without any changes. Each time, that a feature is to be developed, a separate branch shall be created for it, which will be later copied to master branch.\n<\/p>\n<h2>3. Renaming Git Branch<\/h2>\n<p>To understand this example, we shall first create a Git repository, then will create its branch, and finally will rename it.<\/p>\n<p>First step, we shall be creating a directory for our master branch.<\/p>\n<p><figure id=\"attachment_36538\" aria-describedby=\"caption-attachment-36538\" style=\"width: 563px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryForMasterBranch.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36538\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryForMasterBranch.jpg\" alt=\"Create directory for Master Branch\" width=\"563\" height=\"361\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryForMasterBranch.jpg 563w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryForMasterBranch-300x192.jpg 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/a><figcaption id=\"caption-attachment-36538\" class=\"wp-caption-text\">Create directory for Master Branch<\/figcaption><\/figure><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Once the directory has been created we shall be initializing our branch with <code>git init<\/code> command.<\/p>\n<p><figure id=\"attachment_36539\" aria-describedby=\"caption-attachment-36539\" style=\"width: 564px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/InitializeGitBranch.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36539\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/InitializeGitBranch.jpg\" alt=\"Initialize Git Branch\" width=\"564\" height=\"363\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/InitializeGitBranch.jpg 564w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/InitializeGitBranch-300x193.jpg 300w\" sizes=\"(max-width: 564px) 100vw, 564px\" \/><\/a><figcaption id=\"caption-attachment-36539\" class=\"wp-caption-text\">Initialize Git Branch<\/figcaption><\/figure><\/p>\n<p>Post initialization of master branch, we shall add some files and shall commit the same using <code>git commit<\/code> command.<\/p>\n<p><figure id=\"attachment_36540\" aria-describedby=\"caption-attachment-36540\" style=\"width: 567px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/AddFilesToMasterBranchAndCommit.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36540\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/AddFilesToMasterBranchAndCommit.jpg\" alt=\"Add files to Master Branch and Commit\" width=\"567\" height=\"361\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/AddFilesToMasterBranchAndCommit.jpg 567w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/AddFilesToMasterBranchAndCommit-300x191.jpg 300w\" sizes=\"(max-width: 567px) 100vw, 567px\" \/><\/a><figcaption id=\"caption-attachment-36540\" class=\"wp-caption-text\">Add files to Master Branch and Commit<\/figcaption><\/figure><\/p>\n<p>Now that our master branch is ready, we shall create a directory where we shall be creating a new branch.<\/p>\n<p><figure id=\"attachment_36541\" aria-describedby=\"caption-attachment-36541\" style=\"width: 566px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryWhereNewBranchShallBeCreated.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36541\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryWhereNewBranchShallBeCreated.jpg\" alt=\"Create directory where new Branch shall be created\" width=\"566\" height=\"362\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryWhereNewBranchShallBeCreated.jpg 566w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateDirectoryWhereNewBranchShallBeCreated-300x192.jpg 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/a><figcaption id=\"caption-attachment-36541\" class=\"wp-caption-text\">Create directory where new Branch shall be created<\/figcaption><\/figure><\/p>\n<p>And here we shall be cloning the original master branch using <code>git clone<\/code> command.<\/p>\n<p><figure id=\"attachment_36542\" aria-describedby=\"caption-attachment-36542\" style=\"width: 564px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CloneMasterIntoNewlyCreatedBranch-Directory.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36542\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CloneMasterIntoNewlyCreatedBranch-Directory.jpg\" alt=\"Clone Master into newly created branch directory\" width=\"564\" height=\"362\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CloneMasterIntoNewlyCreatedBranch-Directory.jpg 564w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CloneMasterIntoNewlyCreatedBranch-Directory-300x193.jpg 300w\" sizes=\"(max-width: 564px) 100vw, 564px\" \/><\/a><figcaption id=\"caption-attachment-36542\" class=\"wp-caption-text\">Clone Master into newly created branch directory<\/figcaption><\/figure>[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<p>And now we shall be creating a new branch using command <code>git branch &lt;branch_name&gt;<\/code>. Available branches can be seen using command <code>git branch<\/code>.<\/p>\n<p><figure id=\"attachment_36543\" aria-describedby=\"caption-attachment-36543\" style=\"width: 566px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateBranch.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36543\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateBranch.jpg\" alt=\"Create Branch\" width=\"566\" height=\"365\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateBranch.jpg 566w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/CreateBranch-300x193.jpg 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/a><figcaption id=\"caption-attachment-36543\" class=\"wp-caption-text\">Create Branch<\/figcaption><\/figure><\/p>\n<p>Till now we have successfully created our new branch, it&#8217;s time to switch to it. We shall use command <code>git checkout &lt;branch_name&gt;<\/code> to switch to it. Information on current branch can be seen using command <code>git status<\/code>.<\/p>\n<p><figure id=\"attachment_36544\" aria-describedby=\"caption-attachment-36544\" style=\"width: 563px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/SwitchToNewBranch.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36544\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/SwitchToNewBranch.jpg\" alt=\"Switch to new Branch\" width=\"563\" height=\"361\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/SwitchToNewBranch.jpg 563w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/SwitchToNewBranch-300x192.jpg 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/a><figcaption id=\"caption-attachment-36544\" class=\"wp-caption-text\">Switch to new Branch<\/figcaption><\/figure><\/p>\n<p>And then a thought came that we should rename our branch to a more appropriate name. For this we shall be using command <code>git branch -m &lt;new_branch_name&gt;<\/code> to rename existing branch.<\/p>\n<p><figure id=\"attachment_36545\" aria-describedby=\"caption-attachment-36545\" style=\"width: 567px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/RenameGitBranch.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36545\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/RenameGitBranch.jpg\" alt=\"Rename Git Branch\" width=\"567\" height=\"366\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/RenameGitBranch.jpg 567w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/RenameGitBranch-300x194.jpg 300w\" sizes=\"(max-width: 567px) 100vw, 567px\" \/><\/a><figcaption id=\"caption-attachment-36545\" class=\"wp-caption-text\">Rename Git Branch<\/figcaption><\/figure><\/p>\n<h2>4. Conclusion<\/h2>\n<p>In this example, we learnt basics of <code>git branch<\/code> command and how to rename existing git branches.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this example we shall learn how to rename a Git branch. 1. Pre-requisites To see this example in action, Git should be installed. It can be downloaded from here. 2. Git Branch Git branches aren\u2019t like SVN branches which most of us use. The main purpose of SVN branches is to capture large-scale development &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":[1457,1455,1456,1453],"class_list":["post-36421","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-branching","tag-dvcs","tag-rename-branch","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 Rename Branch Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example we shall learn how to rename a Git branch. 1. Pre-requisites To see this example in action, Git should be installed. It can be downloaded\" \/>\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-rename-branch-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Rename Branch Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example we shall learn how to rename a Git branch. 1. Pre-requisites To see this example in action, Git should be installed. It can be downloaded\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-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-25T12:00:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-23T11:52:48+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=\"2 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-rename-branch-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/\"},\"author\":{\"name\":\"Saurabh Arora\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5bf4e0274824642c44536b83ddbfaf6c\"},\"headline\":\"Git Rename Branch Example\",\"datePublished\":\"2016-04-25T12:00:18+00:00\",\"dateModified\":\"2019-04-23T11:52:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/\"},\"wordCount\":466,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"branching\",\"dvcs\",\"rename branch\",\"version control\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/\",\"name\":\"Git Rename Branch Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2016-04-25T12:00:18+00:00\",\"dateModified\":\"2019-04-23T11:52:48+00:00\",\"description\":\"In this example we shall learn how to rename a Git branch. 1. Pre-requisites To see this example in action, Git should be installed. It can be downloaded\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-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-rename-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 Rename 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 Rename Branch Example - Java Code Geeks","description":"In this example we shall learn how to rename a Git branch. 1. Pre-requisites To see this example in action, Git should be installed. It can be downloaded","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-rename-branch-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Rename Branch Example - Java Code Geeks","og_description":"In this example we shall learn how to rename a Git branch. 1. Pre-requisites To see this example in action, Git should be installed. It can be downloaded","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-04-25T12:00:18+00:00","article_modified_time":"2019-04-23T11:52:48+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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/"},"author":{"name":"Saurabh Arora","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5bf4e0274824642c44536b83ddbfaf6c"},"headline":"Git Rename Branch Example","datePublished":"2016-04-25T12:00:18+00:00","dateModified":"2019-04-23T11:52:48+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/"},"wordCount":466,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["branching","dvcs","rename branch","version control"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/","name":"Git Rename Branch Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2016-04-25T12:00:18+00:00","dateModified":"2019-04-23T11:52:48+00:00","description":"In this example we shall learn how to rename a Git branch. 1. Pre-requisites To see this example in action, Git should be installed. It can be downloaded","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-branch-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-rename-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-rename-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 Rename 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\/36421","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=36421"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/36421\/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=36421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=36421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=36421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}