ZANARDI Bruno

Software Developper

About
Resume

Git Blog

Git command `commit`

Definition

Stores the current contents of the index in a new commit along with a log message from the user describing the changes.

note:

  • A commit must be atomic, ie changes which involve only one (small) functionnality
  • Always put a small message which explain what changes occured in this commit.

Basic usage

Tells Git to save current validated changes into a commit

$ git commit -m "<message>"

The commit will contains all changes in your working directory, even if you didn’t validate them with git add

$ git commit -a -m "<message>"

Advanced usage

Corrects the last unpushed commit.

$ git commit --ammend -m "<message>"