Member-only story

How To Manage Branches in Your GitHub Repository

An overview to create, switch, and delete a branch

Eugenia Anello
Better Programming
5 min readAug 1, 2022

Photo by Arno Smit on Unsplash

This post continues with the story How To Update Your GitHub Repository in Visual Studio Code. In the previous post, I explained how to clone your GitHub repository on VS Code, commit and push changes, and make a pull request. These are fundamental operations when working in a team.

But there was another topic which wasn’t covered — the management of branches. As you know, when you create a GitHub repository, a branch is automatically created and is called main. This default branch displays the official code of the repository. Intuitively, you would directly work on the main branch, but it can become messy when working with other people.

If you and another teammate work on the same branch, it can create only confusion since everyone has a different way of thinking. For this reason, there is the exigence of alternative branches: there should be the main branch, while at the same time, each person within the team should work on a different branch.

In this way, there is always a copy of the original code, and eventually, you can merge the changes of your alternative branch into the main branch through a pull request. Let’s begin this tutorial!

Prerequisites

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Eugenia Anello
Eugenia Anello

Written by Eugenia Anello

Data Scientist | Top 1500 Writer on Medium | Love to share Data Science articles| https://www.linkedin.com/in/eugenia-anello

Responses (1)

Write a response