Branch: A separate line of work in a Git repository, so you can make changes without affecting the main code until they are ready and reviewed.

Example

Your task is to add a search filter. You create a branch called feature/search-filter, make your commits there, and the main branch stays untouched until your pull request is approved.

Why Teams Use Branches

  • Several people can work on different tasks at the same time.
  • Unfinished or broken work doesn't affect the stable code.
  • Every change can be reviewed before it is merged.
  • A bad change can be dropped by simply deleting the branch.

Common Branch Names

BranchPurpose
main (or master)Stable, accepted code
developIntegration branch in some teams, before release
feature/...One feature or task
bugfix/... or hotfix/...A bug fix, or an urgent production fix
release/...Preparing a specific release

Many teams include the ticket number, such as feature/PROJ-142-search-filter. Follow your team's convention.

Useful Commands

CommandWhat it does
git branchList local branches
git switch -c feature/xCreate a new branch and switch to it
git switch mainMove back to main
git branch -d feature/xDelete a merged branch

Before creating a branch, pull the latest main so you start from up-to-date code.

Related terms

Previous term: Blocker  |  Next term: Bug

Related guides

Frequently asked questions

What is a branch in Git?

A branch is a separate line of development in a repository, so you can work on changes without affecting the main code.

Why do we use branches in Git?

To work on several tasks in parallel, keep unfinished work away from stable code, and review changes before merging.

How do I create a branch in Git?

Use git switch -c branch-name, or git checkout -b branch-name in older Git versions.

Should I work directly on the main branch?

No. In team projects, create a branch for each task and merge it through a pull request.

Explore more internship terms

The IT Internship Glossary explains 199 terms you will hear before and during your internship, with simple definitions and real examples.

Browse all 199 terms
Dhaivat Ajwaliya

About the author

Dhaivat Ajwaliya

Dhaivat has 16+ years of experience in the IT industry, working on AI and cloud technologies, project delivery, and engineering leadership. He has interviewed and mentored many interns, wrote The Lost Intern, and runs the non-commercial Career Impact Initiative, mentoring students for free.