{"id":4836,"date":"2025-06-02T15:06:00","date_gmt":"2025-06-02T15:06:00","guid":{"rendered":"https:\/\/gitprotect.io\/blog\/?p=4836"},"modified":"2025-09-11T15:22:39","modified_gmt":"2025-09-11T15:22:39","slug":"how-to-create-a-new-branch-in-github","status":"publish","type":"post","link":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/","title":{"rendered":"How To Create a New Branch In GitHub?"},"content":{"rendered":"\n<p>Managing different features and fixes without tangling the core code is crucial. This is where the understanding of branching in <a href=\"https:\/\/gitprotect.io\/blog\/is-github-a-safe-place-for-your-source-code\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a> enters the chat. Think of a branch in GitHub as a parallel universe for your project, where you can experiment, develop, and refine new features or fixes, all without impacting the main codebase.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Git branches function as separate versions of the main repository, allowing users to work on different parts of a project without affecting the main branch. It\u2019s a fundamental practice that not only keeps your project organized but also creates a flexible and collaborative development environment. Branches are often created on the local machine before being pushed to the remote repo.<\/p>\n\n\n\n<p>Understanding these techniques will not only make you a branch master but also improve your workflow, ensuring that your development process is as streamlined and error-free as possible. So, let\u2019s begin this journey to analyze the practicalities and strategies of managing branches effectively in GitHub.<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is a git branch?<\/strong><\/h2>\n\n\n\n<p>In Git, a branch can be thought of as a unique set of code changes with a distinct name. Much like a real tree branch, it stems from the main trunk (the <strong><em>main<\/em><\/strong> or <strong><em>master<\/em><\/strong> branch) and has its own path of growth. Git handles branches uniquely \u2014 each branch is just a movable pointer to a commit, which makes creating and managing branches fast and lightweight. In simpler terms, a branch in GitHub typically diverges from the main trunk, often known as the master branch, allowing parallel development. Just check out the git branch benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Isolated environments<\/strong>: Each branch serves as a <a href=\"https:\/\/gitprotect.io\/blog\/4-reasons-to-treat-backup-as-a-vital-part-of-jira-sandbox-to-production-migration\/\" target=\"_blank\" rel=\"noreferrer noopener\">sandbox<\/a> for specific tasks, whether it\u2019s for feature development, bug fixing, or experimentation, ensuring the main codebase remains stable.<\/li>\n\n\n\n<li><strong>Parallel development<\/strong>: Branches enable multiple team members to work on different aspects of the project simultaneously, improving collaboration and speeding up development.<\/li>\n\n\n\n<li><strong>Risk reduction<\/strong>: Changes in a branch do not affect the main codebase, which maintains overall project stability.<\/li>\n<\/ul>\n\n\n\n<p>What are the reasons for creating a new branch? Well, they can be different. You may need to create a <strong>feature branch<\/strong> for focused and isolated development, a <strong>bugfix branch<\/strong> to address and test fixes separately, or an <strong>experimental branch<\/strong> to keep untested changes away from the main codebase. Everything depends on your needs. Using <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/gitprotect.io\/blog\/git-commands-list-with-examples\/\">Git commands<\/a> like git branch and git checkout, you can create and manage new branches within a <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/gitprotect.io\/blog\/git-and-why-version-control-systems-are-now-more-critical-than-ever\/\">version control system<\/a>, initiating new features by creating new branches off the main branch.<\/p>\n\n\n\n<p>These different branches, each serving a specific purpose, ensure that the development process is streamlined and manageable, regardless of the project\u2019s size or complexity. Git\u2019s branching model supports fast, efficient development, making sure developers can create, merge, and delete branches in a git repo without overkill.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Ways to create a new branch in GitHub<\/strong><\/h2>\n\n\n\n<p>Mastering is essential for managing code changes effectively. For example, you can create a new branch specifically for a feature or bug fix to keep your main codebase clean and organized. New branches are usually branch-based, which stem from a concrete base branch or commit. Let\u2019s outline multiple methods to suit your workflow preferences.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a branch via the branches overview<\/h3>\n\n\n\n<p>Creating a new branch directly from the GitHub web interface is a straightforward process that doesn\u2019t require any command-line tools. It\u2019s particularly useful for those who prefer a more visual approach or for quick branch creation without leaving the browser.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the main page of your <a href=\"https:\/\/gitprotect.io\/blog\/github-repository-vs-project\/\" target=\"_blank\" rel=\"noreferrer noopener\">repository on GitHub<\/a>.<\/li>\n\n\n\n<li>As soon as you open the repo, the \u201cCode\u201d tab will be the first thing you see. Click on the \u201cMain\u201d button a little below it.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"839\" height=\"337\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-on-GitHub.png\" alt=\"How to create a new branch in GitHub1\" class=\"wp-image-4837\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-on-GitHub.png 839w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-on-GitHub-300x121.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-on-GitHub-768x308.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-on-GitHub-400x161.png 400w\" sizes=\"(max-width: 839px) 100vw, 839px\" \/><\/figure><\/div>\n\n\n<p>3. Then you will see a small window where you will need to provide a name for your new branch. Here you can specify branch details:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"838\" height=\"552\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/how-to-vreate-a-new-GitHub-branch.png\" alt=\"How to create a new branch\" class=\"wp-image-4838\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/how-to-vreate-a-new-GitHub-branch.png 838w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/how-to-vreate-a-new-GitHub-branch-300x198.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/how-to-vreate-a-new-GitHub-branch-768x506.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/how-to-vreate-a-new-GitHub-branch-400x263.png 400w\" sizes=\"(max-width: 838px) 100vw, 838px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Under \u201cBranch name\u201d, enter a name for your new branch.<\/li>\n\n\n\n<li>Under \u201cBranch source\u201d, select the source from which you want to create the branch. By default, it will be the current default branch of the repo.<\/li>\n\n\n\n<li>If your <a href=\"https:\/\/gitprotect.io\/blog\/git-forking-workflow\/\" target=\"_blank\" rel=\"noreferrer noopener\">repository is a fork<\/a>, you also have the option to choose whether the branch should be created in your fork or the upstream repo.<\/li>\n<\/ul>\n\n\n\n<p>Click \u201cCreate branch\u201d to finalize the process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a branch using the branch dropdown<\/h3>\n\n\n\n<p>For a quick creation of a new git branch from any page within your repository, you should:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open the branch dropdown<\/strong>: On the main page of your repo, locate the branch dropdown menu. It\u2019s typically at the top of the file tree view or integrated file editor.<\/li>\n\n\n\n<li><strong>Enter new name<\/strong>: In the \u201cFind or create a branch\u2026\u201d text field, type a unique name for your new branch.<\/li>\n\n\n\n<li><strong>Create and switch<\/strong>: Once you create a new branch, you can easily switch branches within the GitHub interface.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/gitprotect.io\/devops-backup-academy.html\" target=\"_blank\" rel=\" noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"346\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/banner_orange-1-1024x346.png\" alt=\"DevOps Backup Academy\" class=\"wp-image-6763\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/banner_orange-1-1024x346.png 1024w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/banner_orange-1-300x102.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/banner_orange-1-768x260.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/banner_orange-1-400x135.png 400w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/banner_orange-1.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Creating a new branch using the command line<\/h3>\n\n\n\n<p>It\u2019s possible to do almost anything in GitHub using the command line, and the command prompt is a key tool for executing Git commands. Creating a new branch is not an exception. This approach is both simple to use and has no significant drawbacks. However, you should remember that if you use it locally, other users won\u2019t see your modification until you push it to the remote branch. Thus, your \u201cnew\u201d version of the GitHub repo can become too different from the master copy, the existing branch.<\/p>\n\n\n\n<p>So, here is the way to create a new branch via the command line:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Access your command line interface.<\/li>\n\n\n\n<li>Make sure you\u2019re in the directory of your local Git repository.<\/li>\n\n\n\n<li>Create the branch:<\/li>\n<\/ul>\n\n\n\n<p>To create a new branch and remain on your current branch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>git branch &lt;your-git-branch-name><\/code><\/code><\/pre>\n\n\n\n<p>To create a new branch and switch to it immediately: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>git checkout -b &lt;your-git-branch-name><\/code><\/code><\/pre>\n\n\n\n<p>This command starts the branch from the current HEAD, making it easy to branch off your latest commit.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><strong>\ud83d\udca1 Note<\/strong>: When you create a new local branch using this method, it\u2019s initially only available in your local repo. To share the new local branch with your team, push it to the remote repository using: <strong>git push -u origin &lt; your-git-branch-name><\/strong>. Once merge conflicts are resolved, you should run the command <strong>git add<\/strong> on each file to mark it as resolved, to stage the file in Git, and indicate that you are ready to proceed with the merge process. After completing adding the files, simply merge by committing the changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Orphan branches<\/h3>\n\n\n\n<p>An orphan branch is a branch with no commit history. It\u2019s useful for starting from scratch within an existing repo or for documentation purposes.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create an orphan branch<\/strong>: Use the command <strong><em>git checkout \u2013orphan &lt;your-git-branch-name><\/em><\/strong> in your command line. This will create a new branch, but unlike regular branches, it has no shared history with the main branch.<\/li>\n\n\n\n<li><strong>Initial commit<\/strong>: As this branch has no history, start by creating an initial commit. The initial commit, often called the \u2018first commit,\u2019 defines the starting point of the new branch&#8217;s history.<\/li>\n<\/ol>\n\n\n\n<p>Remember, when working with orphan branches, you\u2019re essentially starting a new history independent of your main project\u2019s history.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Are there any other branching alternatives?<\/strong><\/h3>\n\n\n\n<p>Branching in Git is not limited to the standard methods. There are several other alternatives that cater to different preferences and project requirements. Exploring these can enhance your workflow efficiency and adaptability. Why not look at them more precisely?<\/p>\n\n\n\n<p>Additionally, it is important to merge changes back into the main project to maintain clean and effective version control.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Advanced command-line techniques<\/h4>\n\n\n\n<p>For developers who are comfortable with the command line, Git offers a suite of advanced features for branch management. These include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Checking out remote branches<\/strong>: <strong><em>git checkout \u2013track origin\/&lt;branchname><\/em><\/strong> to create a local branch that tracks a remote branch in your remote repo. This is particularly useful for collaborating on branches that are in the remote repository but not yet in your local one.<\/li>\n\n\n\n<li><strong>Renaming branches<\/strong>: <strong><em>git branch -m &lt;oldname> &lt;newname><\/em><\/strong> helps in renaming a branch, especially useful if the scope or purpose of the branch changes.<\/li>\n\n\n\n<li><a href=\"https:\/\/gitprotect.io\/blog\/bitbucket-how-to-restore-deleted-branch\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Deleting branches<\/strong><\/a>: Carefully use <strong><em>git branch -d &lt;branchname><\/em><\/strong> to delete a branch once its changes have been merged or are no longer needed. Developers often compare and merge two branches to integrate them and resolve differences.<\/li>\n<\/ul>\n\n\n\n<p>By using these advanced Git commands, you can create and manage your desired new branches efficiently. This way, you make space for more complex workflows and better project organization.ed new branches efficiently. This way, you make space for more complex workflows and better project organization.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">GitHub desktop<\/h4>\n\n\n\n<p>GitHub Desktop simplifies Git commands into a user-friendly interface. It\u2019s particularly useful for those who prefer a GUI over command-line operations. Here are the step-by-step instructions to create branches using this method:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the \u2018Current Repository\u2019 view, choose the branch you want as your base, and click \u2018New Branch\u2019.<\/li>\n\n\n\n<li>Name your branch and click \u2018Create\u2019. To make it available on GitHub, click \u2018Publish branch\u2019.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">IDE integration<\/h4>\n\n\n\n<p>Many Integrated Development Environments (IDEs) now have built-in Git support, allowing you to manage branches within the IDE itself. This integration allows you to directly create and switch between branches without leaving the IDE environment. Some IDEs provide a graphical representation of the branch history, making it easier to understand the project\u2019s branching structure.<\/p>\n\n\n\n<p>Each of these alternatives offers unique benefits. The choice of method often depends on personal preference, project needs, and the complexity of the tasks at hand.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a branch from a specific point<\/h2>\n\n\n\n<p>Sometimes you may need to start a branch not from the latest commit, but from an earlier point in your project&#8217;s history (a commit or tag). This is especially useful for developing a new feature, fixing a bug, or experimenting without relying on the current branch tip.<\/p>\n\n\n\n<p>You can create a new branch from a chosen commit or tag with the git branch command, followed by the branch name and the commit hash or tag. If you want to both create and switch to the branch in one step, you can use the git checkout command -b (or git switch -c in newer Git versions).<\/p>\n\n\n\n<p>Branching from a stable commit lets you isolate changes, ensuring that your new work doesn\u2019t disrupt ongoing development. With the Git branch command, you can create, switch, and manage branches at any point in the repository\u2019s history, keeping your workflow flexible and organized.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Managing existing branches<\/strong><\/h2>\n\n\n\n<p>When it comes to managing your existing branches, remember that it is an essential part of the <a href=\"https:\/\/gitprotect.io\/blog\/git-workflows\/\" target=\"_blank\" rel=\"noreferrer noopener\">Git workflow<\/a>. Proper branch management guarantees that your repos stay organized, as well as your development processes become more efficient. Let\u2019s take a look at the <a href=\"https:\/\/gitprotect.io\/blog\/devops-security-data-protection-best-practices\/#Apply_penetration_testing_and_automated_continuous_security_monitoring\" target=\"_blank\" rel=\"noreferrer noopener\">tips<\/a> to help you with the management of your branches.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Best practices for branch management<\/h3>\n\n\n\n<p>For starters, in order to see all existing branches in your local repository, use the git branch command and run it with no arguments. This will display a list of your current branches. However, you can also use the <em>-merged<\/em> and <em>-no-merged<\/em> options to filter this list to show only branches that you have or have not yet merged into the branch you\u2019re currently on.<\/p>\n\n\n\n<p>Remember that once a branch has already been merged with another branch, you can simply delete it by using the git branch -d &lt;branch-name&gt; command. This helps keep your repository tidy and organized by removing branches that are no longer of any use. On this list, branches without the * in front of them can be deleted using git branch -d;. That is because you have incorporated them into another branch; therefore, no data will be lost. When it comes to deleting a branch that has not yet been merged with any other branch, git branch -d will not work. To force delete, you should add -D to the command in order to erase the work. However, always make sure to have your <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/gitprotect.io\/ci-cd-guide.html\">data backed up<\/a> before any deletions to keep it secure and available.<\/p>\n\n\n\n<p>Next, we have switching between branches. You can use the git checkout &lt;branch-name&gt; command to effectively switch between branches. This should permit you to move from one branch to another in most cases. Now, to merge changes from one branch into another, use the git merge command. This way, you integrate the changes from the specified branch into your current one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Useful commands to switch between branches<\/h2>\n\n\n\n<p>Let\u2019s take a look at how to switch between branches in more detail, as it is a common operation in Git. It allows you to move between different lines of development, from testing to production.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simply <strong>switch branches<\/strong> using \u201cgit checkout &lt;branch-name>\u201d.<\/li>\n\n\n\n<li><strong>Create and switch<\/strong> to a new branch, run \u201cgit checkout\u201d with adding \u201c-b\u201d in order to specify the branch name. Alternatively, in Git 2.23, use the \u201cgit switch\u201d command, and use the create-branch option: \u201c-c &lt;branch-name>\u201d.<\/li>\n\n\n\n<li><strong>Switch to the previous branch<\/strong> by running \u201cgit switch -\u201c.<\/li>\n\n\n\n<li>To <strong>view commit history,<\/strong> use \u201c<a href=\"https:\/\/gitprotect.io\/blog\/how-to-use-git-reflog-reflog-vs-log\/\" target=\"_blank\" rel=\"noreferrer noopener\">git log<\/a>\u201d that will show you all commits made so far in the working directory.<\/li>\n\n\n\n<li><strong>Check the current status<\/strong> by running \u201cgit status\u201d.<\/li>\n<\/ul>\n\n\n\n<p>Now, by following these couple of pointers, you can switch between branches more efficiently, and in turn guarantee that your development process remains smooth as well as organized.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/gitprotect.io\/git-commands-cheat-sheet.html\" target=\"_blank\" rel=\" noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1.png\" alt=\"Git Commands Cheat Sheet\" class=\"wp-image-7431\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1.png 1024w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1-300x300.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1-150x150.png 150w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1-768x768.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1-180x180.png 180w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1-400x400.png 400w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1-600x600.png 600w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2025\/06\/git-commands-1024x1024-1-800x800.png 800w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Takeaway<\/h2>\n\n\n\n<p>To sum up, mastering branching in GitHub is a crucial skill for effective version control and team collaboration. Whether it\u2019s through the straightforward methods provided by the GitHub interface or the more advanced command-line techniques, each approach offers unique benefits tailored to different project needs. Understanding these methods allows you to leverage branching to its full potential, enhancing code management, facilitating parallel development, and ensuring smooth project progress.<\/p>\n\n\n\n<p>Remember, the effectiveness of branching largely depends on how well it\u2019s integrated into your team\u2019s workflow, making it an essential aspect of modern software development. You can read more about git branching strategies in our blog post: <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/gitprotect.io\/blog\/from-novice-to-pro-understanding-git-branching-strategies\/\">From Novice to Pro: Understanding Git Branching Strategies<\/a>.<\/p>\n\n\n\n<p>And don\u2019t forget about the importance of keeping your GitHub data safe and secure in the event of a disaster. Try GitProtect.io backups for GitHub and <a href=\"https:\/\/gitprotect.io\/sign-up.html\" target=\"_blank\" rel=\"noreferrer noopener\">ensure compliant DevOps backup and recovery with a 14-day trial<\/a> \ud83d\ude80.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Before you go<\/h2>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\">\ud83d\udd0e Learn more about <a href=\"https:\/\/gitprotect.io\/blog\/github-security-best-practices-15-tips-to-keep-in-mind\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub security best practices<\/a> to ensure your DevOps environment is safe and sound<br>\ud83d\udd0e Find out which <a href=\"https:\/\/gitprotect.io\/blog\/github-backup-best-practices\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub backup best practices<\/a> can help you always stay afloat<br>\ud83d\udd0e Continue mastering your GitHub issues &#8211; check our <a href=\"https:\/\/gitprotect.io\/blog\/mastering-github-issues-best-practices-and-pro-tips\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub issues best practices and PRO tips<\/a><\/p>\n\n\n\n<p><strong><em>The article was originally published on February 9th, 2024<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing different features and fixes without tangling the core code is crucial. This is where the understanding of branching in GitHub enters the chat. Think of a branch in GitHub as a parallel universe for your project, where you can experiment, develop, and refine new features or fixes, all without impacting the main codebase.<\/p>\n","protected":false},"author":12,"featured_media":4840,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4836","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-github","post--single"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Create a New Branch In GitHub? - Blog | GitProtect.io<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Create a New Branch In GitHub? - Blog | GitProtect.io\" \/>\n<meta property=\"og:description\" content=\"Managing different features and fixes without tangling the core code is crucial. This is where the understanding of branching in GitHub enters the chat. Think of a branch in GitHub as a parallel universe for your project, where you can experiment, develop, and refine new features or fixes, all without impacting the main codebase.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | GitProtect.io\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/XoperoSoftware\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-02T15:06:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-11T15:22:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:site\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/\"},\"author\":{\"name\":\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05\"},\"headline\":\"How To Create a New Branch In GitHub?\",\"datePublished\":\"2025-06-02T15:06:00+00:00\",\"dateModified\":\"2025-09-11T15:22:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/\"},\"wordCount\":2416,\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png\",\"articleSection\":[\"GitHub\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/\",\"name\":\"How To Create a New Branch In GitHub? - Blog | GitProtect.io\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png\",\"datePublished\":\"2025-06-02T15:06:00+00:00\",\"dateModified\":\"2025-09-11T15:22:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\/\/gitprotect.io\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Create a New Branch In GitHub?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"name\":\"GitProtect.io Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gitprotect.io\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\",\"name\":\"GitProtect.io\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"width\":528,\"height\":528,\"caption\":\"GitProtect.io\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/XoperoSoftware\/\",\"https:\/\/x.com\/GitProtectio\",\"https:\/\/www.linkedin.com\/company\/xopero-software\/\",\"https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05\",\"name\":\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png\",\"caption\":\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\"},\"description\":\"Milosz is Technical Content Writer at GitProtect, demonstrating fluency in both Polish and English, and a passion for language and technology. Currently pursuing a degree in Philosophy at UWE Bristol, he excels in creating engaging technical content that bridges the gap between users and the emerging technologies. Milosz leverages his writing skills and technical knowledge to author articles and blog posts, with a focus on DevOps, cyber-security, and potential cyber-threats, among other crucial IT topics. Additionally, valuable translations provided by Milosz further enhance GitProtect's communication and global outreach.\",\"url\":\"https:\/\/gitprotect.io\/blog\/author\/milosz-jesis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Create a New Branch In GitHub? - Blog | GitProtect.io","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:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/","og_locale":"en_US","og_type":"article","og_title":"How To Create a New Branch In GitHub? - Blog | GitProtect.io","og_description":"Managing different features and fixes without tangling the core code is crucial. This is where the understanding of branching in GitHub enters the chat. Think of a branch in GitHub as a parallel universe for your project, where you can experiment, develop, and refine new features or fixes, all without impacting the main codebase.","og_url":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/","og_site_name":"Blog | GitProtect.io","article_publisher":"https:\/\/www.facebook.com\/XoperoSoftware\/","article_published_time":"2025-06-02T15:06:00+00:00","article_modified_time":"2025-09-11T15:22:39+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png","type":"image\/png"}],"author":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","twitter_card":"summary_large_image","twitter_creator":"@GitProtectio","twitter_site":"@GitProtectio","twitter_misc":{"Written by":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#article","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/"},"author":{"name":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05"},"headline":"How To Create a New Branch In GitHub?","datePublished":"2025-06-02T15:06:00+00:00","dateModified":"2025-09-11T15:22:39+00:00","mainEntityOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/"},"wordCount":2416,"publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png","articleSection":["GitHub"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/","url":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/","name":"How To Create a New Branch In GitHub? - Blog | GitProtect.io","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png","datePublished":"2025-06-02T15:06:00+00:00","dateModified":"2025-09-11T15:22:39+00:00","breadcrumb":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#primaryimage","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/02\/How-to-create-a-new-branch-in-GitHub.png","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/gitprotect.io\/blog\/how-to-create-a-new-branch-in-github\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/gitprotect.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Create a New Branch In GitHub?"}]},{"@type":"WebSite","@id":"https:\/\/gitprotect.io\/blog\/#website","url":"https:\/\/gitprotect.io\/blog\/","name":"GitProtect.io Blog","description":"","publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gitprotect.io\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gitprotect.io\/blog\/#organization","name":"GitProtect.io","url":"https:\/\/gitprotect.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","width":528,"height":528,"caption":"GitProtect.io"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/XoperoSoftware\/","https:\/\/x.com\/GitProtectio","https:\/\/www.linkedin.com\/company\/xopero-software\/","https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w"]},{"@type":"Person","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05","name":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png","caption":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io"},"description":"Milosz is Technical Content Writer at GitProtect, demonstrating fluency in both Polish and English, and a passion for language and technology. Currently pursuing a degree in Philosophy at UWE Bristol, he excels in creating engaging technical content that bridges the gap between users and the emerging technologies. Milosz leverages his writing skills and technical knowledge to author articles and blog posts, with a focus on DevOps, cyber-security, and potential cyber-threats, among other crucial IT topics. Additionally, valuable translations provided by Milosz further enhance GitProtect's communication and global outreach.","url":"https:\/\/gitprotect.io\/blog\/author\/milosz-jesis\/"}]}},"_links":{"self":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/4836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/comments?post=4836"}],"version-history":[{"count":5,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/4836\/revisions"}],"predecessor-version":[{"id":7433,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/4836\/revisions\/7433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media\/4840"}],"wp:attachment":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media?parent=4836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/categories?post=4836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/tags?post=4836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}