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.

Creating a Git branch

Creating a Git branch

- [Instructor] Recall that git branches are useful for separating different parts of your code base, trying out new features without affecting your main code, and collaborating with others on these changes. Let us review the steps that go into creating a git branch. First, open up your terminal or command prompt window. Navigate to your working directory. Here we're going to reuse some familiar commands to create a new branch. Let's check firstly what branch we're currently on by running our git branch command. You should see a list of branches in your repository with the current branch highlighted with an asterisk. Currently we only have one, which is the main branch. To create a new branch, type in git branch followed by the name of the new branch. So in this case, let us say we want a branch called my new branch. We can then switch to this new branch using our git checkout and then the name of the branch. Do recall…

Contents