🌱 BasicsCommonly used
How to make a commit in Git
Save staged changes to the repository with a message.
Commit with a message
git commit -m "your message here"Creates a commit with the staged files and the given message.
When to use: Standard way to commit. Use a descriptive message.
Stage and commit in one step
git commit -am "your message"Stages all tracked modified files and commits in one command. Does not include new untracked files.
Only works for files already tracked by Git. New files still need git add first.
Commit with a detailed message
git commitOpens your default editor to write a commit title and body. First line = title, blank line, then body.
When to use: When your commit needs more context than a one-liner.
Empty commit (useful for CI triggers)
git commit --allow-empty -m "trigger CI"Creates a commit with no file changes. Useful for triggering CI/CD pipelines.