Instructor: I'm having here some sample project, which in this case is an Angular project. It doesn't matter, because what we would like to look now at is how we can commit single files into our Git repository. I've made a couple of changes.
I've worked quite for a while, so I have changed here, for instance, in the app component. I've changed some HTML and some title here. Then, I've also added some files, some new packages to my application which then change here to package JSON, to package log file, and some other kind of files in my repository such as the index HTML.
If you jump over to our terminal and do a Git status, we see all of these files that have been changed. Actually, I don't want to commit them all at once with a single commit message because there are different things I did here in this modifications.
What I would like to comment is these two files, because I've actually changed some behavior of the app like changing the title. The other files, I would like to actually commit separately, because in those commits, I've actually added the new package to my application.
Let's create the first commit. I can do a git add to add our files to the staging areas such that they can then be committed into our repository. Let's use the source app app.component.html as well as the source app app.component.ts file.
I can commit these files individually by simply appending one path after the other two to get at command. I could also use wildcard. I could do the app.component*, which would then commit basically both the HTML and the TS part. Now, you can see these two are ready. They are in the staging area for my git repository. I could simply do a git commit -m and say feet, change to title of the app.
Let's do another git status. Now we see those two fonts have been committed. We just have the remaining ones here in our repository left. Again, we could now selectively pick some of these files or rather do a git at dot for all of them, because they all belong to the same operation and do a git commit -m install Angular material.
If you now do a git status, we see we have a clean history. Let's take a look at our log. We can now see we have a log for installation of Angular material and a log for the new feature of our app where we changed actually the title.