From the course: Designing and Implementing Source Control using GitHub and Azure DevOps

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Understanding Git branches

Understanding Git branches

- [Instructor] Git branches are a powerful feature that lets developers work on different versions of the same code base simultaneously. Let's talk about what Git branches are, how they work, and why you should use them. When you create a new Git repository, you start with a single branch called master, or more recently, main. This branch represents the main version of your code base, which everyone on your team will be working on. But what if you want to work on a new feature or fix a bug without affecting the main version of the code? This is where Git branches come in. To create a new branch, you use the git branch command. It is common practice to name a new branch based on its purpose. Let's say you want to create a branch for a new feature you're working on. You might call this branch New Feature. Once you've created the new branch, you need to switch to it using the git checkout command. Now you're working on the…

Contents