This tutorial will walk through the setup of a simple node web application. We’ll use git for version control and keep our remote repository on GitHub.
Tech Stack
In this tutorial, we’ll do the setup for getting started with a simple express app.
Set up local and remote git repositories
(1) Create the project folder and initialize the local git repository
mkdir myProject && cd myProject
git init
# Initialized empty Git repository in /Users/disaza/myProject/.git/
This creates a git repository on your local machine. It’s called your local repository.
(2) Create the LICENSE at the root of the project folder
Default content for the LICENSE file:
echo "(c) Copyright 2018 Dan Isaza. All rights reserved.">> LICENSE
Check that the contents of the LICENSE file were set properly by concatenating the contents of the file to the terminal with cat LICENSE
disaza:myProject
↳ cat LICENSE
# (c) Copyright 2017 Dan Isaza. All rights reserved.
Add and commit the file to the local git repository
git add .
git commit -m “initial commit”
(3) Create a new repository on GitHub
We can sync the folder myProject with a copy of itself stored in the cloud. This cloud version of myProject is called the remote repository.
We can connect to the remote repository through the git command line interface(CLI). But first, we’ll need to create a remote repository and sync it with connect it to our local copy.
It’s common practice to match the name of your project folder and GitHub repository. This newly created repository is called your remote repository.
For a more complete intro to git, check out: Git Basics
Security Note:
Remember, if you make your repository public, it’sopenly available on the internet. GitHub provides a helpful list of things to remember to leave out of any code you check into version control:
“Warning: Never git add, commit, or push sensitive information to a remote repository. Sensitive information can include, but is not limited to:
Set up local and remote git repositories
mkdir myProject && cd myProject
git init
# Initialized empty Git repository in /Users/disaza/myProject/.git/
echo "(c) Copyright 2018 Dan Isaza. All rights reserved." >> LICENSE
disaza:myProject
↳ cat LICENSE
# (c) Copyright 2017 Dan Isaza. All rights reserved.
git add .
git commit -m “initial commit”