23
How I set up a brand-new React app
The first thing I do with a new app is to create a new git branch to work on so I'm not pushing to main. I never know what I'm going to do first, so I just call it "first". Yes, I know that's basic of me. Type the following into your terminal:
git checkout -b first
or git checkout -b whateveryouwannacallit
.Ok, so you've checked out a new branch called first. Once you're ready to make your initial push of the branch first to git, make sure you use the command
git push -u origin first
. The added u
sets up tracking information so that during future pushes, you can do git pull without having to specify the remote or the branch.There's a bunch of files in your automatically-created new app that you don't necessarily need. Some people delete them but I just move them to a new folder I create called "DELETE" juuuuust in case I need them at some point down the road. They include the following:
remove from
public
directory:remove from
src
directory:npm install react-bootstrap bootstrap@4.6.0
npm install react-router-dom
At some point, fill that
README
with useful content by visiting MakeAReadMe.com which provides handy Read Me templates.23