Skip to main content
RapidDev - Software Development Agency
github-for-non-tech

How to Create a New Branch on GitHub

A branch is a parallel copy of your code where you can make changes without affecting the main version. To create one on GitHub, click the branch dropdown on your repository page (it says "main"), type a new branch name, and click "Create branch." The new branch starts as an exact copy of main. Make your changes there, then merge them back when ready. Branches are how teams safely experiment and collaborate.

What you'll learn

  • What a branch is and why you need one
  • How to create a new branch using the GitHub web interface
  • Branch naming conventions and best practices
  • How branches connect to pull requests
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read3 minutesAny GitHub account (Free, Pro, Team, Enterprise) — works in all modern browsersMarch 2026RapidDev Engineering Team
TL;DR

A branch is a parallel copy of your code where you can make changes without affecting the main version. To create one on GitHub, click the branch dropdown on your repository page (it says "main"), type a new branch name, and click "Create branch." The new branch starts as an exact copy of main. Make your changes there, then merge them back when ready. Branches are how teams safely experiment and collaborate.

What Are Branches and Why Do They Matter?

Think of your repository's main branch as the published, stable version of your project. A branch is like making a photocopy of the entire project — you can scribble on the copy, experiment, and make changes without touching the original. When you are happy with your changes, you merge the branch back into main. This is how professional development teams work: nobody edits main directly. Instead, each person works on their own branch and merges when their changes are reviewed and approved. Branches are especially important when using AI tools like Lovable, which syncs two-way with the main branch. If you want to try something risky — like redesigning a page or changing your database schema — do it on a branch first. That way, if something breaks, your live project on main stays safe. Creating a branch on GitHub takes about 10 seconds and requires zero technical knowledge.

Prerequisites

  • A free GitHub account (sign up at github.com)
  • A repository with at least one commit (even just a README.md)
  • Write access to the repository

Step-by-step guide

1

Open your repository on GitHub

Go to github.com and navigate to your repository. You will see the file list with a dropdown button near the top-left that shows "main" (or whatever your default branch is called). This dropdown is the branch selector — it shows you which branch you are currently viewing.

Expected result: You are on the main page of your repository with the branch dropdown showing "main."

2

Click the branch dropdown

Click the dropdown button that says "main" (or your default branch name). A panel opens showing your existing branches (you may only have main so far) with a search field at the top that says "Find or create a branch." This is where you will create your new branch.

Expected result: The branch dropdown panel is open showing existing branches and a search/create field.

3

Type your new branch name

In the "Find or create a branch" field, type the name for your new branch. Use a descriptive name that explains what you plan to work on. Good examples: "add-pricing-page", "fix-login-bug", "update-homepage-hero". Use lowercase letters and hyphens between words — no spaces. As you type, GitHub shows a "Create branch: your-branch-name from main" option below the field.

Expected result: You see a "Create branch: your-branch-name from main" option below the search field.

4

Click Create branch to finish

Click the "Create branch: your-branch-name from main" option. GitHub instantly creates the branch and switches your view to it. The dropdown button now shows your new branch name instead of "main." The file list looks exactly the same — that is expected, because the new branch is an identical copy of main at this point.

Expected result: The branch dropdown shows your new branch name. The repository contents look the same as main.

5

Start making changes on your new branch

You are now working on your new branch. Any edits you make — editing files with the pencil icon, uploading new files, or deleting files — will only affect this branch. The main branch stays untouched. Make your changes, and when you are ready, you can open a pull request to merge them into main (see our merging tutorial for details).

Expected result: You can edit, upload, or delete files and all changes are isolated to your new branch.

Complete working example

CONTRIBUTING.md
1# Contributing to This Project
2
3## Branch Naming Conventions
4
5Always create a new branch for your changes. Never edit main directly.
6
7### Branch name format
8
9```
10<type>/<short-description>
11```
12
13### Types
14
15| Prefix | Use for |
16|------------|-------------------------------|
17| feature/ | New features or pages |
18| fix/ | Bug fixes |
19| update/ | Updates to existing features |
20| docs/ | Documentation changes |
21| design/ | UI/styling changes |
22
23### Examples
24
25- `feature/add-user-dashboard`
26- `fix/login-redirect-loop`
27- `update/pricing-table-values`
28- `docs/api-reference`
29- `design/dark-mode-toggle`
30
31## Workflow
32
331. Create a branch from main
342. Make your changes
353. Open a pull request
364. Get at least one review
375. Merge to main

Common mistakes when creating a New Branch on GitHub

Why it's a problem: Using spaces or special characters in branch names

How to avoid: Branch names cannot contain spaces. Use hyphens instead: "add-pricing-page" not "add pricing page." Avoid special characters like @, #, or $.

Why it's a problem: Creating a branch but forgetting to switch to it before editing

How to avoid: After creating the branch, confirm the dropdown shows the new branch name (not main) before you start editing files.

Why it's a problem: Never merging or deleting old branches, cluttering the repo

How to avoid: After your changes are merged via a pull request, delete the branch. GitHub offers a delete button right after merging.

Why it's a problem: Creating a branch from the wrong starting point

How to avoid: Make sure the dropdown shows "main" (or your intended base branch) before you type the new branch name. The new branch copies whatever branch is currently selected.

Best practices

  • Always create a branch before making changes — never edit main directly.
  • Use descriptive branch names that explain what you are working on.
  • Follow a naming convention: feature/, fix/, update/, docs/ prefixes help teams stay organized.
  • Keep branches short-lived — make your changes and merge within a few days.
  • Delete branches after merging to keep the repository clean.
  • Create one branch per feature or fix — do not bundle unrelated changes.
  • Check which branch is selected before editing files on GitHub.

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I am working on a GitHub repository for a web app built with Lovable. When should I create a branch versus committing directly to main? Explain branches in simple terms for a non-developer.

Frequently asked questions

What happens to my main branch when I create a new branch?

Nothing. The main branch is completely unaffected. The new branch is an independent copy. Changes on the new branch do not show up on main until you explicitly merge them.

Can I create a branch from a branch (not from main)?

Yes. Make sure the branch dropdown shows the branch you want to copy from before you type the new name. The new branch will be an exact copy of whichever branch is currently selected.

How many branches can I have?

There is no practical limit. Repositories can have hundreds of branches. However, keeping too many stale branches makes the repo messy. Delete branches after merging.

Do branches affect my Lovable or V0 project?

Lovable syncs with the main branch by default. Changes on other branches will not appear in Lovable until they are merged into main. V0 follows a similar pattern when connected via GitHub.

Can two people work on the same branch at the same time?

Technically yes, but it can cause conflicts. It is better for each person to have their own branch. They merge into main separately, and GitHub helps resolve any overlapping changes.

Can RapidDev help set up a branching strategy for my team?

Yes. RapidDev helps non-technical founders establish branching workflows, naming conventions, and code review processes that keep projects organized as the team grows.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.