wiki:git-commits
Table of Contents
Git Commits
Commits are snapshots of your project at a point in time. Each commit has a unique hash, an author, a timestamp, message, and the full state of all tracked files. You can view history, revert to old commits, and understand who changed what and why.
$ git add file.txt # stage a file $ git commit -m "message" # create a commit from staged changes $ git show <hash> # view a commit's changes $ git revert <hash> # create a new commit that undoes an old one
Commits are immutable once created—you cannot change a commit's content or message without creating a new commit. This makes history reliable and auditable. Always write clear commit messages that explain the “why”, not just the “what”.
wiki/git-commits.md · Last modified: (external edit)
