Git Commit Message
A commit message is the text saved with a commit. It tells others (and your future self) what changed and why.
Keep the first line short and clear, like "Added image to Hello World". Use -m to write it on the command line; without -m, Git opens your editor.
Write a message with -m
git commit -m "Added new line to index.html"
[main 90fe82c] Added new line to index.html
1 file changed, 1 insertion(+)
Fix the last message
--amend replaces the last commit with a new one that has the new message:
git commit --amend -m "Added .gitignore"
[main a85bb36] Added .gitignore
Date: Thu Nov 5 10:00:00 2026 +0100
1 file changed, 2 insertions(+)
create mode 100644 .gitignore