Stage & Commit Changes in Git
From the Git cheat sheet · Making Changes · verified Nov 2026
Stage & Commit Changes
Save your work to the repository history
bash
# Stage files
git add <file>
git add . # All changes in current dir
git add -A # All changes in whole repo
git add -p # Interactive staging
# Commit
git commit -m "message"
git commit -am "message" # Add + commit tracked files
git commit --amend # Modify last commit💡 Stage files before committing
⚠️ Amend rewrites history - don't amend pushed commits
✅ Write clear, descriptive commit messages
⚡ Use -p for selective staging
Continue with Git
Save the full cheat sheet or work through every related task.