Commits Commands
Learn to craft meaningful commits, amend mistakes, and manage your project's commit history. Good commit practices make collaboration easier and help future you understand past decisions.
13 commands
Pro Tips
Write commit messages in imperative mood: 'Add feature' not 'Added feature'. This matches Git's own generated messages.
Use 'git commit --amend' to fix the last commit's message or add forgotten files - but only for unpushed commits.
Keep commits atomic - each commit should represent one logical change that can be understood and reverted independently.
Common Mistakes
Never amend commits that have been pushed to shared branches. This rewrites history and can break collaborators' work.
Avoid commits with messages like 'fix' or 'wip' - future you will have no idea what was changed.