So once I create that .gitignore file and
then add node_modules into the .gitignore file, let's save the changes.
And then we will now do a commit of the current state of our project
into our Git repository.
I hope you remember your git commands.
Let's do a git status, and then when you do that,
you will immediately notice that you have the index.html
file marked as modified, and then the two new files, .gitignore and package.json.
So, we do a git add ., and then do a git status.
And then you see that all this new files have been checked in into your commit.
Let's do a git commit. git commit -m "fourth commit".
And the files are committed.
Let's push the new commit to our online repository.
So, to do that git push -u
origin master and wait for
it to be pushed to our server.
Now, if you go to your online Git repository,
you will see that the package.json file and
.gitignore would have been checked in into your Git repository.
Going to my Bitbucket repository from the Git test, you will see that
when I look at the source, you will see that the package.json file has been added.
The .gitignore has been added and the new index.html file has been checked in.
So that completes this exercise.
So in this exercise,
we have learned how to set up a package.json file using npm init.
We have learned how to install an npm module.
And we have learned how to use the lite-server npm module to serve up
the contents of our project folder so that it can be viewed in a browser.
So, this is a nice way of serving up your web contents,
your web application or your website, so
that you can see changes in real time being reflected to your browser window.
And then we also saw how we can setup the .gitignore so that some
folders can be excluded from being checked into our Git repository.
This completes this exercise.
So with this, I'm sure you have gotten a good handle on
the use of both Git, and then also node and node modules.
Don't worry, we will be using node extensively, in various ways,
as you go through the courses of this specialization.
This is just a start.
[MUSIC]