Actions

EmSys

Git - Committing Changes

From EdWiki

Revision as of 09:59, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- From Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GitLab - Committing Changes

  • Goals
    Learn how to commit changes to the repository
  • Commit the change
    Let’s commit what we have staged to the repository.

When you used git commit previously to commit the initial version of the hello.c file to the repository, you included the -m 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
VISUAL environment variable
EDITOR environment variable

e.g.,

git config --global core.editor vim