Commit and Push to Main
Follow these steps to commit and push changes:
- •
Check current status
- •Run
git statusto see all changed files - •Run
git diff --stagedandgit diffto understand changes - •Run
git log -3 --onelineto see recent commit style
- •Run
- •
Stage changes
- •Stage specific files (preferred) or use
git add -Afor all changes - •Never stage sensitive files (.env, credentials, etc.)
- •Stage specific files (preferred) or use
- •
Create commit
- •Write a concise commit message (1-2 sentences) focusing on "why" not "what"
- •Follow conventional commit style if the repo uses it
- •End with:
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> - •Use HEREDOC format for the commit message
- •
Push to main
- •Ensure you're on the main branch:
git checkout main - •Push:
git push origin main
- •Ensure you're on the main branch:
- •
Verify
- •Run
git statusto confirm clean working tree - •Confirm push succeeded
- •Run
Important:
- •If not on main branch, ask user before switching
- •If there are merge conflicts, stop and explain
- •Never force push without explicit user permission