Key concepts

Branch

In Git, a branch is a sequence of commits that represents the evolution of the project (or a specific feature) over time. There's always at least one branch in a repository, usually called the main branch. You can create new branches to work on new features or bug fixes and merge them back into the main branch when they're ready. Branches let you work on multiple features at the same time without interfering with each other.

Branches are lightweight and easy to create and manage in Git. They allow you to experiment with new ideas, work on different features in parallel, and isolate changes from the main branch until they're ready to be integrated. Branches are a powerful tool for organizing and managing your project's development workflow.

When you create a new branch, it starts from the latest commit on the current branch.

Examples

Create a new branch called new-feature and switch into it right away:

git switch -c new-feature

Switch to the main branch:

git switch main

Merge the other-feature branch into the current branch:

git merge other-feature

Delete the other-feature branch:

git branch -d other-feature
© 2024-2025 GitByBit.All rights reserved.

Hi! I'm Alex, creator of GitByBit.

And this is Gitopedia—a reference that summarizes knowledge in my Git course.

Gitopedia is designed to be a personal knowledge base. When you progress through the main Git course in VS Code, you unlock all of these topics, one by one, bit by bit. This gives you time to digest the information and gradually build the mental model of Git. Here's an example of how it works:

Learning directly in VS Code lets you practice Git exactly as you would in real life, doing real jobs, writing real code. In addition, the course has access to your actual terminal, so it can point out mistakes, suggest workarounds, etc.

The course is FREE, there are no Ads or other bullshit. There are optional premium add-ons you can purchase, mainly to support my work (regrettably, I have to eat every day), but that's totally up to you.

Learn Git in VS Code