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.
- Initialize a Git repository in your project folder.
- Create a
.gitignorefile with the common files and folders from this lesson. - Add your files to the staging area and make your first commit.
- 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.