# Commit

Once you've made all the necesaries changes in the repo, and you want to save them in git's history, you need to make a commit.

A commit basically is a group of changes that are saved and identified as a point in the history of the repo, which is very useful because it allows to easily idetify all the changes made over time.

Each commit has the following data:

  • message: a descriptive message of that commit
  • hash: an alphanumeric id of that commit
  • author: commit's author
  • date: date of commit

To create a commit, you run the following command:

git commit -m 'descriptive message'

This will include all of those files that were in the staging area into a commit, and the changes made will be grouped in that commit, being registered in git's history and acceisible in the future.

Once the commit is done, git status command will indicate all the files that were not int the staging area, if any.

In order to see the commit's history of a branch in a repo, you can use git log command:

git log

This will display a chronological list of all the commits that are included in the current branch.