git-commit-push
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-current
2. Review Changes
git diff
# or if files already staged:
git diff --staged
3. Stage Files
Stage all changes:
git add .
Stage specific files:
git add path/to/file1 path/to/file2
Stage by pattern:
git add src/components/*.tsx
4. 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 push
First push (set upstream):
git push -u origin HEAD
6. Verify
git log --oneline -3
git status
Complete Examples
Commit and push all changes:
git add .
git commit -m "feat: add dark mode toggle"
git push
Commit specific files:
git add src/auth.ts src/middleware.ts
git commit -m "feat(auth): implement JWT verification"
git push
Commit with body:
git add .
git commit -m "feat(search): add elasticsearch integration
- Configure ES client
- Add search endpoint
- Implement result ranking
Closes #234"
git push
Git 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
More from pc-style/pc-skills
blog-post
Create pcstyle.dev developer blog posts in the dual-author (ME MYSELF + MY AI AGENT) format, including MDX structure, custom components, and API/CLI publishing steps.
4code-review
Run automated code review using cubic review with amp review fallback. Use when the user wants to review code changes, check PR quality, analyze code for issues, or run automated code review tools.
4load-handoff
Load a handoff file and proceed with the specified tasks. Use when starting a new session with a HANDOFF.md file present, or when the user asks to continue from a handoff. Reads the handoff context and immediately begins executing the next steps.
3explore-codebase
Fast codebase exploration using Opencode's Explore agent for quick recognition of project structure, file patterns, and code organization. Use when you need to understand a codebase quickly, map out architecture, find files by patterns, or answer questions about code structure. Triggers on requests like "explore this codebase", "understand the project structure", "map out the architecture", or when quick file discovery is needed.
3git-push-origin
Push local branch to origin (GitHub) to initialize it remotely. Use when the user has created a local branch and wants to push it to GitHub for the first time, or when setting up a new branch on the remote repository.
3create-handoff
Create a handoff message to continue work in a new AI session. Use when the user wants to save context for later, create a handoff document, or prepare work for continuation in a fresh session. Captures relevant files, context, and goals so the next session can start immediately without rediscovering the codebase.
3