4.2 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 Section 7.3, Keeping Up-to-Date and Section 7.4, 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 ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.