Branches are a core feature of Git. A branch allows you to work on a different "version" of your project. Take a look at the following image:

<aside> ❗
Git branching and merging is a complex topic that requires practice. It's normal to feel lost at the beginning, but you'll improve with time and experience.
</aside>
When you create a new Git repository, it comes with a default branch. This is usually the primary branch where your code lives, and it's often the branch that is published to the users. In older versions of Git, this default branch was called master. However, in newer versions, it's called main.
<aside> 💭
Watch the first 11:30 minutes of the video below - Stop watching, right before the ‘Merging’ topic
</aside>
Git Branching and Merging - Detailed Tutorial
Key takeaways so far:
git branch <branch-name> . This will not automatically switch to the new branch.git checkout <branch-name> or git switch <branch-name>git checkout -b <new-branch-name><aside> ⌨️
Hands on:
Merging is the process of combining changes from one branch into another. When we’ve completed work on a feature branch, we’ll typically want to merge those changes back into the main branch.
To merge a branch into your current branch, use the command git merge <branch-name>. For example, if you're on the main branch and want to merge changes from a feature branch, you would run git merge feature-branch.
<aside> 💭
Continue watching the previous tutorial from minute 11:31 until the end
</aside>
Git Branching and Merging - Detailed Tutorial
The video covered an important topic: "Feature branches workflow". Professional developers and companies use this process extensively, so it's important to practice it:
<aside> ⌨️
Hands-on: Practice a simple GitHub workflow:
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 **
