Committing Changes

Committing is a relatively straightforward process that adds your changes to the history of your repository and assigns a commit name to them.

The change is not sent to a central repository, though. Other people can pull the change from you, or you can push the change to some other repository, but there’s no automatic updating. We’ll talk about these in Keeping Up-to-Date and Pushing Changes.

You can use git commit in multiple ways to commit changes to your repository, but every commit requires a log message. For simple messages, you can add a message by adding -m "your message". The message can be any valid string. You can also specify multiple paragraphs by passing multiple -m options to git commit.

For more complex ...

Get Pragmatic Version Control Using Git now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.