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
From the course: Designing and Implementing Source Control using GitHub and Azure DevOps
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
-
-
-
-
-
-
(Locked)
Understanding Git branches1m 45s
-
(Locked)
Creating a Git branch3m 2s
-
(Locked)
Using pull requests2m 4s
-
(Locked)
Merging a pull request in Git2m 26s
-
(Locked)
Understanding Git merge methods2m 36s
-
(Locked)
Performing a merge and rebase4m 51s
-
(Locked)
Handling merge conflicts3m 30s
-
(Locked)
Git branching strategies2m 16s
-
(Locked)
Using the Git flow branching strategy4m 41s
-
(Locked)
-
-