Git Branch — Free Git & GitHub Tutorial
Learn Git Branch in Git & GitHub with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Git Branch in Git & GitHub with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Git Branch in Git & GitHub
A branch is an independent line of development. The main branch (usually "main" or "master") is production-ready. Feature branches let you work on new features without affecting the main code. Git makes switching between branches instant and safe.
Think of branches like parallel universes: you can change things in one branch without affecting another. When the feature is done and tested, you merge it back into main.
Priya creates a "homepage" branch to work on the homepage design. Arjun creates a "login-feature" branch to build login functionality. They work independently, and their changes don't interfere.
Git Branch — Syntax
git branch # List local branches git branch <branch-name> # Create new branch git branch -d <branch-name> # Delete branch git branch -a # List all (local + remote)
Learn Git Branch step by step with Syllab's free interactive Git & GitHub tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Git & GitHub course →