Here's how to create a new branch in Git and push it to GitHub to that branch.
For example, your new branch name is development.
1. Check Current Branch
git branch
2. Create a New Branch and Switch to It
git checkout -b development
Or using the newer Git version:
git switch -c development
3. Confirm You Are on the New Branch
git branch
Active branch is usually marked with an asterisk (*), for example:
* development
main
4. Add File Changes
git add .
5. Commit Changes
git commit -m "Initial commit on development branch"
6. Push the New Branch to GitHub
git push -u origin development
After running this command, the development branch will automatically appear in your GitHub repository.
๐ก Tip: For subsequent pushes on the same branch, you don't need to type the full command again. Just use:
git push
Full Workflow Example:
git checkout -b development
git add .
git commit -m "Update project"
git push -u origin development
Tags:
#Programming
W
Written by
Wilan
A regular contributor to Bali Island Tekno who actively shares knowledge about technology, programming, and the world of software engineering.
Back to Home
Updated on: June 15, 2026