You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You just learned how to create a branch—the first step in the GitHub flow.
Branches are an important part of the GitHub flow because they allow us to separate our work from the main branch. In other words, everyone's work is safe while you contribute.
Tips for using branches
A single project can have hundreds of branches, each suggesting a new change to the main branch.
The best way to keep branches organized with a team is to keep them concise and short-lived. In other words, a single branch should represent a single new feature or bug fix. This reduces confusion among contributors when branches are only active for a few days before they’re merged 📖 into the main branch.
⌨️ Activity: Your first branch
Download and open Visual Studio Code (referred to as VS Code) if you don't already have it.
In VS Code, open the Command Palette using Ctrl+Shift+P on Windows, or Command ⌘+Shift+P on macOS. You can also follow VS Code's official documentation on cloning.
Type: git clone and press Enter
Paste in the URL of the repository in the new window and press Enter:
https://github.com/ChrisHary/github-slideshow.git
Select the location in which to save the repository and click Choose folder. Then, open the location you selected.
The repository folder should now be open in your VS Code project. Click on main at the bottom left of the VS Code window. This will bring up the Command Palette with the commands related to Git branches.
Click Create new branch and enter any branch name you'd like, such as my-slide. Then press Enter.
When asked to select the ref to create the branch from, select main.
Go to the Source Control view, click on the ellipsis (...) and select Push. Confirm the dialog box asking you to publish the branch.
I'll respond when I detect a new branch has been created in this repository.
Activity
github-learning-lab commentedon Dec 7, 2020
Step 4: Create a branch
Let’s complete the first step of the GitHub flow: creating a branch 📖.
Creating a branch
Creating a branch
📺 Video: Branches
You just learned how to create a branch—the first step in the GitHub flow.
Branches are an important part of the GitHub flow because they allow us to separate our work from the
mainbranch. In other words, everyone's work is safe while you contribute.Tips for using branches
A single project can have hundreds of branches, each suggesting a new change to the
mainbranch.The best way to keep branches organized with a team is to keep them concise and short-lived. In other words, a single branch should represent a single new feature or bug fix. This reduces confusion among contributors when branches are only active for a few days before they’re merged 📖 into the
mainbranch.⌨️ Activity: Your first branch
git cloneand press Entermainat the bottom left of the VS Code window. This will bring up the Command Palette with the commands related to Git branches.my-slide. Then press Enter.main.I'll respond when I detect a new branch has been created in this repository.