8. Commiting the changes

Goals

To learn to commit to the repository

01 Committing changes

Well, enough about staging. Let’s commit the staged changes to the repository.

When you previously used git commit for committing the first hello.html version to the repository, you included the -m flag that gives a comment on the command line. The commit command allows interactively editing comments for the commit. And now, let’s see how it works.

If you omit the -m flag from the command line, git will pop you into the editor of your choice from the list (in order of priority):

GIT_EDITOR environment variable

core.editor configuration setting

VISUAL environment variable

EDITOR environment variable

I have the EDITOR variable set to emacsclient (available for Linux and Mac).