commit-push

Stage all changes, commit with conventional prefixes, and push to the current branch.

3|1|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/heyAyushh/stacc --skill commit-push
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-push
Source: https://github.com/heyAyushh/stacc/tree/main/configs/commands/skills/commit-push
Command: npx skills add https://github.com/heyAyushh/stacc --skill commit-push

SYSTEM DOCUMENTATION & REQUIREMENTS

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"

Frequently Asked Questions about commit-push

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate a git commit and push while preventing direct pushes to main?

Automating a git commit and push with branch protection stages all changes with git add, creates a conventional commit message, and blocks pushes to main or master by checking the current branch before pushing to origin with upstream tracking.

What is the safest workflow to commit changes and push to a remote branch?

The safest commit and push workflow checks the current branch against main or master, stages all modifications with git add -A, commits using conventional prefixes like fix or feat, and pushes to origin with upstream tracking enabled.

Can I push local commits to origin without accidentally updating the master branch?

Yes, pushing to origin without updating master is possible by validating the current branch name before execution; if the branch is main or master, the operation aborts to enforce branch protection rules during collaboration.

How do I set upstream tracking automatically when pushing a new git branch?

Setting upstream tracking automatically during a push uses the git push -u origin command with the current branch name, linking the local branch to the remote repository and simplifying future updates.

Does this commit and push workflow require any external git dependencies?

No external dependencies are required; the commit and push workflow operates using standard git commands available in local repositories, making it suitable for collaboration setups without additional installed packages.

Why should I use conventional commit prefixes when pushing to a protected branch?

Using conventional commit prefixes like fix or feat when pushing to a protected branch standardizes commit history, improves collaboration readability, and ensures structured updates across guarded remote branches.