Let’s Start From Scratch

Gerardmistretta
4 min readMay 10, 2021

They say that teaching is one of the best ways to reinforce knowledge and confirm your grasp on a subject. Well I hope this is true, because for some reason every time I try to create a new repository, I find a way to complicate things. Over the last month or so I’ve spent a lot of time studying data structures and algorithms; but now seemed like a good time to kick this bad habit and go back to the basics. That is why I am going to create a step-by-step guide going over how to create a new repository in Github and how to get things up and running in your local terminal.

^ Every New Software Developer Right Now ^

While I’m sure there are many ways to create new repositories and get things up and running, I will go through the way that has been most successful for me. The first few steps are pretty self-explanatory. Go to Github, log in, and go to “Your Repositories”. If you do not already have an active Github account, you probably aren’t ready to immediately jump into building projects. Assuming you do have an account, you will want to click “New” which will be the green button on the right side of your screen. This will direct you to a page where you can name your repository and add a brief description.

Create A New Repo Page

Now, from here I usually just click “Create Repository” but depending on if you want your work open to the public, feel free to adjust the settings to accommodate your preferences. I also do not initialize the repository with a README or anything else, as this can be taken care of in a later step.

Once you’ve created the repository, keep this page open for later and go to your local terminal. You should CD into the folder you are looking for, or mkdir <my-git-project> if you need to create a new directory.

Next, you will want to go back to Github. You will have a few options to import some code, create a new repository, or push an existing one. The easiest option is to simply copy the code in the Quick Setup:

Quick Setup Code

Go back to your terminal and run “git clone <whatever-that-code-was-you-just-copied>. This will set everything up in your local terminal. You will probably get a warning saying you cloned an empty repository like the one I got below. For now, disregard that message. And don’t forget to CD into the file before you open it up in VS Code!

Terminal Steps

You will notice your Repo is completely empty. Don’t panic! We did not set anything up yet; and that was the warning we received earlier. All of that is about to change very quickly.

By running npx create-react-app <name-this-file> in the VS terminal, you will set up a foundation with plenty of boiler plate code in place. This also accomplishes a lot behind the scenes, such as installing React, linking dependencies, fetching packages, building fresh packages, and removing/installing too many things to count.

To put this step into perspective, every one of these folders and files was just created by running that one line of code; including the README:

Wow, that’s a lot!

From here, it would be a good idea to run all of your Git commands to lock it in(“git add .”, “git commit -m”, and “git push”). Hopefully this will help a lot of aspiring Software Engineers out when they first begin building new projects from scratch. If nothing else, I hope it reinforces things enough for myself so I can consider these steps second-nature and focus on the more complicated details of web development.

One last thought, imagine having to set all of this up from scratch every time. I don’t know about you, but to me that seems very time-consuming and repetitive. Thankfully, you do not need to worry about that. The final step is to CD into the last file you named when you ran npx create-react-app <name-this-file>. After that, happy hacking!

--

--