Making a new branch
When working with GitHub, it's common to create a new branch when working on a new feature, such as the mobile navigation we're about to add.
It's more beneficial when you are working in teams, but even if you're working solo, it means you can muck about and try new things without worrying about breaking your production site.
It makes it very easy to discard code if you end up doing something that doesn't work out as well.
Creating a branch
There are a lot of ways to use Git, but for this course I want to keep it as simple as possible, so we're going to use VS Code's built in source control.
We can either do this from the source control panel, or a small little button at the bottom of VS Code.
When you click that, at the top of VS Code, you'll get a menu that pops up.
- Create new branch... will create a new branch from the current commit
- New branch from... allows you to create a new branch for a specific branch or commit
The latter can be useful, but we don't need to do that right now, so we can select the first one.
It'll ask us to name the branch, which you generally want name after the feature you are working on, so we can go with "mobile navigation" or something similar.