Repaso
EspaƱol
Maven, Git & SDLCFoundationsVCS-28

What is a Git commit?

Options

  1. A snapshot of your staged changes, with a message (Correct option)
  2. Deleting a file from the project working directory
  3. Sending the code to the production environment
  4. A branch that is created from the current commit

Answer

A saved snapshot of your staged changes in the project history, with a message describing it

Why

The file history appears as snapshots in time called commits.

You choose what goes in the snapshot with git add, then save it with git commit -m "Fix login error". Each commit has an ID, an author, a date and a message.

Good commits are small and have clear messages in the imperative: 'Add', 'Fix', 'Remove'.

Remember

Commit = a snapshot with a message.

Key terms

Practice this question in Repaso