{"id":9748,"date":"2017-09-19T13:58:38","date_gmt":"2017-09-19T17:58:38","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=9748"},"modified":"2020-03-12T14:39:24","modified_gmt":"2020-03-12T18:39:24","slug":"how-to-create-a-branch-of-a-repository-on-github","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/wordpress-tutorials\/how-to-create-a-branch-of-a-repository-on-github\/","title":{"rendered":"How to Create a Branch of a Repository on GitHub"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><h2 id=\"what-is-a-branch\">What is a branch?<\/h2>\n<p>Branches allow you to work on multiple versions of a repository at one time.<\/p>\n<p>&nbsp;<\/p>\n<p>By default your repository has one <b>branch<\/b> named master which is considered to be the main branch of your project. We use branches to experiment and make changes before committing them to the master branch.<br>\nWhen you <strong>create a branch<\/strong> off the master branch, you are basically making a snapshot of the master branch exactly as it is, and you can edit the new branch without affecting the master. The following step by step guide will explain the process for <b>creating a branch<\/b> of your project to modify. <\/p>\n<div class=\"alert alert-info\" role=\"alert\">We are going to be using an <a href=\"https:\/\/github.com\/gitexamples\/my-first-project\" target=\"_blank\" rel=\"noopener noreferrer\">example project we have on GitHub<\/a> for this tutorial<\/div>\n<h2 id=\"create-a-branch-of-your-repository\">Create a branch of your repository<\/h2>\n<ol class=\"article-list\">\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9751\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-01-repo.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Point your browser to the main page of your GitHub Repository\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9752\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-02-branchbutton.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Select the drop down at the top of the file list that says branch: master.\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9753\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-03-namebranch.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Type a unique name for your new branch. We using dev for this example\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9754\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-04-newdevbranch.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Press Enter\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<\/ol>\n<p>Congratulations! You now know how to <strong>create a branch<\/strong> of your repository. In some cases, you may need to <b>delete a branch<\/b>. The following step by step guide will explain how to delete a branch of your GitHub repository. <\/p>\n<h2 id=\"deleting-and-restoring-a-branch-of-your-repository\">Deleting and restoring a branch of your repository<\/h2>\n<ol class=\"article-list\">\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9755\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-05-selectbranches.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Above the list of files, click NUMBER branches.\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9756\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-06-trashbranch.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Scroll to the branch that you want to delete, then click the trash can icon\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9757\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-07-branchdeleted.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>The branch has now been deleted\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-300x149.png\" alt=\"\" width=\"300\" height=\"149\" class=\"alignright size-medium wp-image-9758\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-300x149.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-768x382.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-1024x510.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-250x124.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-550x274.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-800x398.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-362x180.png 362w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-603x300.png 603w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore-1004x500.png 1004w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/08\/9748-08-restore.png 1390w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>To restore a deleted branch, simply click the restore button\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<\/ol>\n<p>Congratulations! You now know how to <strong>create a branche<\/strong>, as well as delete one in your repository on GitHub. <\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>What is a branch? Branches allow you to work on multiple versions of a repository at one time. &nbsp; By default your repository has one branch named master which is considered to be the main branch of your project. We use branches to experiment and make changes before committing them to the master branch. When [&hellip;]<\/p>\n","protected":false},"author":529,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"bgseo_title":"How to Create a Branch of a Repository on GitHub","bgseo_description":"The following tutorial will explain the process for creating a branch as well as deleting and restoring a branch of your GitHub repository. ","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[151],"tags":[],"class_list":["post-9748","post","type-post","status-publish","format-standard","hentry","category-wordpress-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/9748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/users\/529"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=9748"}],"version-history":[{"count":6,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/9748\/revisions"}],"predecessor-version":[{"id":39802,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/9748\/revisions\/39802"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=9748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=9748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=9748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}