What problem does it solve?
This Skill addresses the need to reliably commit local changes and push to the current branch while preventing accidental pushes to protected branches like main or master. It standardizes the workflow to reduce mistakes and improve collaboration.
Core Features & Use Cases
- Stage all changes with git add -A and create a meaningful, conventional commit message.
- Prevent direct pushes to main/master to enforce branch protection during teamwork.
- Push the current branch to origin with upstream tracking in a single, repeatable command sequence.
Quick Start
Use the commit-push skill to commit all changes on the current branch and push to the corresponding remote branch with protection against main/master.
MSG="fix: concise message"
BRANCH=$(git branch --show-current)
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
echo "Direct pushes to main/master not allowed"; exit 1;
fi
git add -A
git commit -m "$MSG"
git push -u origin "$BRANCH"