Stage changes, commit with conventional commits, and push to origin. Use when the user wants to commit and push in one go, save changes to GitHub, or after completing work on a branch. Combines staging, committing, and pushing into a single workflow.
Install
npx skillscat add pc-style/pc-skills/git-commit-push Install via the SkillsCat registry.
SKILL.md
Git Commit and Push
Stage changes, create a conventional commit, and push to origin in one workflow.
When to Use
- Ready to save changes to GitHub
- Work is complete and tested
- Any request to "commit and push" or "save changes"
Workflow
1. Check Current State
git status
git branch --show-current2. Review Changes
git diff
# or if files already staged:
git diff --staged3. Stage Files
Stage all changes:
git add .Stage specific files:
git add path/to/file1 path/to/file2Stage by pattern:
git add src/components/*.tsx4. Create Conventional Commit
Analyze the diff to determine type and scope:
git commit -m "<type>[optional scope]: <description>"Types:
feat:- New featurefix:- Bug fixdocs:- Documentationstyle:- Formattingrefactor:- Code refactoringperf:- Performancetest:- Testschore:- Maintenance
Examples:
git commit -m "feat(auth): add OAuth2 login flow"
git commit -m "fix(api): resolve null pointer exception"
git commit -m "docs: update README with setup instructions"5. Push to Origin
Push current branch:
git pushFirst push (set upstream):
git push -u origin HEAD6. Verify
git log --oneline -3
git statusComplete Examples
Commit and push all changes:
git add .
git commit -m "feat: add dark mode toggle"
git pushCommit specific files:
git add src/auth.ts src/middleware.ts
git commit -m "feat(auth): implement JWT verification"
git pushCommit with body:
git add .
git commit -m "feat(search): add elasticsearch integration
- Configure ES client
- Add search endpoint
- Implement result ranking
Closes #234"
git pushGit Safety Protocol
- NEVER commit secrets (.env, credentials)
- NEVER run
git push --forceto main/master - NEVER use
--no-verifyunless explicitly asked - If commit fails due to hooks, fix issues and create NEW commit
Best Practices
- Commit related changes together
- Write clear, imperative commit messages
- Keep commits atomic (one logical change)
- Push frequently to back up work
- Verify CI passes after push