Git is a critical part of any project and many of you are already familiar with. If you haven't, be sure to initialize your project as a git repo with git init in the root of your project (VSCode and any other number of tools can do this as well.)

If you haven't already, create a .gitignore at the root of your project to ignore the stuff we don't want to commit. Go ahead and put this in there:

node_modules
dist/
.env
.DS_Store
coverage/
.vscode/

This will make it so these things won't get added to our repo. If you want more Git instruction, please check out Git Module.

Practice Exercise

Set up Git for a small project.

  1. Initialize a Git repository in your project folder.
  2. Create a .gitignore file with the common files and folders from this lesson.
  3. Add your files to the staging area and make your first commit.
  4. Create a new branch and make a small change, then switch back to the main branch.

Challenge: inspect the status of your repository before and after each step to see how Git tracks changes.