GitBasics

git commit

Records the currently staged changes as a new commit.

Syntax

git commit -m <message>

Examples

Commit with an inline message

git commit -m "Fix null pointer in auth middleware"

Stage all tracked, modified files and commit in one step

git commit -am "Update docs"

Related commands