GitHuh - Create a New Branch

January 13, 2026

This is an example to create “develop” branch from copying from “main” branch. We can apply the same steps for creating “feature” branch and “release” branch


1. Ensure your repository is clean

git status
git branch -a

2. Preparation before creating a new branch

git checkout {ORIGINAL BRANCH} (e.g, main)
git pull origin {ORIGINAL BRANCH} (e.g, main)

3. Create the new branch locally

git checkout -b {NEW BRANCH} (e.g, develop)

# Sample of feature branch
git checkout -b feature/new_feature_branch_name

# Sample of release branch
git checkout -b release/new_release_branch_name

4. Push the new branch to GitHub

git push -u origin {NEW BRANCH} (e.g, develop)

5. Verify both branches exist

Run:

git branch -a

You should see the new branch

* {NEW BRANCH} (e.g, develop)
  main
  remotes/origin/{NEW BRANCH} (e.g, develop)
  remotes/origin/main

See also:

GitHub - Create a New Repo

GitHub - Create a New Branch

GitHub - Pull Latest Change

GitHub - Pull Request (Azure DevOps)

GitHub - Chean a Branch

GitHub - Delete a Branch

GitHub - Create a Tag

GitHub - Delete a Tag