Now we have a snapshot in the staging area ready to be
permanently stored in our repository. So we type git
commit, dash M for message. And here in double quotes, we type a
short description that identifies what this snapshot
represents. So here I'm going to say, initial commit. Now there
are times that a short one line description is not sufficient.
You want to explain some details to give context. For example, if
you worked on a bug, and there were some constraints at the
time you committed your code, you want to explain those
constraints. This is very valuable to both you and your
coworkers. So in situations like this, we drop the message. We
just type git commit. Now when we press enter, this opens our
default editor, in this case VS code, because at the beginning
of the course, I configured my default editor to be VS code.
Okay. So here we're trying to edit this file, commit,
underlined edit message which stored in our Git subdirectory.
So, on the top, we can type a short description. Ideally,
there should be less than 80 characters, and then we add a
line break. And after that we can type a long description. Now
this lines that start with a pound sign or comments, they're
gonna get ignored. So we typed what everyone here in this case,
I'm going to say, initial command. And this is our first
commit. Of course, this is repetitive. We don't have commit
messages like this. But for this demo, I'm going to go with this
message. So we save the changes. Then, we close this window. Back
in the terminal, our snapshot is committed. And here we have
basic statistics about what was changed. So two files were
changed which are file one and file two. And we have three
insertions, three lines were inserted. In file one, we
inserted two lines, hello world, and in file, two inserted one
line. Now look at this indicator, it turned green,
because our working directory is Now clean, it doesn't have any
new changes. So what we have in our working directory is exactly
the same content we have in our staging area, which is exactly
the same content we have in the last commit.