Core FeaturesLesson 6 of 10

Working with Branches

2 min readGitHub for Designers

Branches let you work on new features or experiments without affecting the main codebase. Think of them as parallel timelines for your project.

Why Use Branches?

  • Work on features without breaking the main code
  • Multiple people can work on different things simultaneously
  • Easy to discard experiments that don't work out
  • Clean history when merging completed features

Create a New Branch

Terminal
# Create and switch to a new branch
git checkout -b feature/new-navigation

# Or with newer Git versions
git switch -c feature/new-navigation

Switch Between Branches

Terminal
# Switch to an existing branch
git checkout main

# See all branches
git branch

Branch Naming Conventions

Most teams use prefixes to categorize branches:

  • feature/ - New features (feature/user-profile)
  • fix/ - Bug fixes (fix/login-error)
  • design/ - Design changes (design/new-color-scheme)
  • docs/ - Documentation (docs/api-guide)
Always Know Your Branch

Before making changes, always check which branch you're on with "git branch" or look at your terminal prompt. Committing to the wrong branch is a common mistake!

Lesson Complete!

  • Create branches for new work
  • Switch between branches
  • Understand branch naming conventions

You're ready to work safely with branches!