Build real web app using .NET Core, Angular 5 and Template Stack templates (Part 3 - add to GitHub)

 Adding things to GitHub could be tricky at the beggining, espacially if you are not very familiar with the commands. In this third part of the topic how to 'Build real web app using .NET Core, Angular 5 and Template Stack templates (Part 3 - add to GitHub)' we will discuss how to it the right way. In order to upload to GitHub we will have to go through these steps:
  • Create GitHub account
  • Install Git bash or Git Shell. We will work with the console. Better to get use to it from the start
  • Create project to GitHub
  • Choose the right .gitignore file and modify it if needed. This is very important step, because we don't want to commit things like node modules, compiled javascript and etc.
  • Init the folder with your project as git repository
  • Add, commit and push the project
The first and second steps I will skip. I believe that everybody should have done that by now.
Creating GitHub project is also quite straightforward. Go to https://github.com/new, add your repository name, choose .gitignore for Visual Studio (very important) and go for 'Create repository'.
img
  Once you have the repository created fallow these steps:

First we will see how to set up Git repository directly in the folder where your source code is

  • 1.Go to your solution folder
  • 2.Open git bash or git shell in it
  • ...
  • 3.Type in - git init
  • 4. git remote add origin PATH/TO/REPO - get the path to repo from your new repository clone or download button
  • 5. git fetch
  • 6. git checkout -t origin/master
  • 7. git add .
  • 8. git commit -m "initial commit"
  • 9. git push - here you would probably be prompt to type in your GitHub credentials

How to set up Git repository coping the source code to another folder

  • 1. Go to empty folder
  • 2.Open git bash or git shell in it
  • 3.Type in - git clone PATH/TO/REPO
  • 4. Copy your project source code in this folder
  • 5. git add .
  • 6. git commit -m "initial commit"
  • 7. git push - here you would probably be prompt to type in your GitHub credentials
  Looks a bit scary at the beggining, but once you set it up it get's easier. Then you can only use up to 2-3 commands in your daily work.
You can check my repository with the application here https://github.com/bonchovylkov/TodoApp