In part 2 we will integrate Git and GitHub in our app. Visual Studio Code has integrated Git support. This makes it an excellent choice to manage our code commits while we develop. If our workspace isn’t under Git source control, we can easily create a Git repository with the Initialize git repository command.
Git tracks the added/changed files and as we can see there are thousands of them!We should add a .gitignore file in order to keep in track only the important files.
So add to the root folder a .gitignore file with this content
typings app/**/*.js app/**/*.map node_modules jspm_packages bower_components
Now we have only a dozen of files!
Write a comment like “Initialize” and then hit Ctrl+Enter and the initialization will take place. We have created a local git repo. We also want to push our code to GitHub.Provided that we already have a GitHub account, we create a new repository
Let’s name our repository Angular2RCWorldNews.When our repo is ready GitHub is giving us instructions on how we can make a remote push.
We copy the instructions to the clipboard and then we paste them to the windows command prompt.Keep in mind that our path is the folder of the application.
Now a remote git push is taking place and when it finishes we can see our code in GitHub.
Latest posts by Giorgos Basagiannis (see all)
- What is the difference between an abstract and a virtual method? - November 26, 2017
- Angular 2 News tutorial in Visual Studio Code part 3 - June 28, 2016
- Angular 2 News tutorial in Visual Studio Code part 2 - June 22, 2016