Committing Changes

    • Learn how to commit changes to the repository

    When you used previously to commit the initial version of the hello.rb file to the repository, you included the flag that gave a comment on the command line. The commit command will allow you to interactively edit a comment for the commit. Let’s try that now.

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

    • GIT_EDITOR environment variable
    • core.editor configuration setting
    • EDITOR environment variable

    So commit now and check the status.

    You should see the following in your editor:

    The “Waiting for Emacs…” line comes from the emacsclient program which sends the file to a running emacs program and waits for the file to be closed. The rest of the output is the standard commit messages.

    Finally let’s check the status again.

    The working directory is clean and ready for you to continue.