- We will learn how to push our code to a GitHub repo!
For this tutorial, you will need to download and install GitHub on your local computer.
- To install GitHub follow the next tutorial:
- Installation guide for Windows, Mac and Linux users
- A new video on how to set up GitHub to push our code will be released soon!
- Set up your GitHub account, select a repo name and create the new repository.
-
We are now ready to push our code to the repo! Open a terminal or a powershell. Make sure GitHub is installed using the next command.
$ git --version
git version 2.34.1
- Configure your user name and email as follows (use your GitHub username and email). These are the commands that you need to run.
$ git config --global user.name "Stelios"$ git config --global user.email youremail@domain.com- Now move to your app folder. You can run the next commands in your VSC terminal while you are in your node.js project app folder.
$ git init - Add the GitHub repo as the origin.
$ git remote add origin https://github.com/steliosot/cc.git- Before you push the data, we will need to make sure that we don't push the
.envfile! For the moment, make sure you delete the DB connection string from your.envfile. We will see soon how to use the.gitignorefiles to help us with this. - Add all the files.
$ git add . - Commit the changes (with a message)
$ git commit -m "Pushing my app files"- Upload the files in the repository.
$ git push -f origin main- Done! You should be able to see your file online

