Once you've staged all of the files that you want to commit, you'll run the "git commit" command. I'll do that, and then show you a couple of options that you can pass to alter the way commits are performed.

I'll type "git commit" and press Enter.

When I do, I'm taken to the commit screen (in the VI editor) and asked to enter my commit message. The message should describe what modifications have been made since the last commit. Since this is our first commit, it's common to simply enter "Initial commit", but you can be more specific if you want.

  • I'll press the "i" key and then type "Initial commit."
  • Then, since I'm in VI, I'll press the escape key, and type ":wq" and press Enter to save and quit

Now, if we scroll up to the line where we performed the commit, we'll see that there are two lines above the list of files that were affected by this commit. They read something like:

[master (root-commit) f133eee] Initial commit
1055 files changed, 319311 insertions(+)

The first line shows us that we committed to the "master" branch (we'll talk about branches in another video, and the commit message was "Initial commit". The second line tells us how many files were changed, the number of line insertions, and if we had deleted anything, it would also show the number of line deletions.

Now, if we run "git status", we'll see the message "nothing to commit (working directory clean)". This means that everything is now under version control.