juniorDevOps
What is Git and how does branching work?
Updated Apr 28, 2026
Short answer
Git is a distributed version control system. Branching allows developers to diverge from the main line of development to work on isolated features.
Deep explanation
In Git, a branch is simply a lightweight movable pointer to a specific commit. Because branches are cheap, developers create them for every feature or bug fix. This ensures the main branch remains stable while experimental work happens in parallel.
Real-world example
Three developers working on different features simultaneously by creating feature/ branches off main and submitting Pull Requests.
Common mistakes
- Working directly on the `main` branch, leading to broken builds and merge conflicts.
Follow-up questions
- What is a merge conflict?