git-push-main

Commit staged changes and push to main in one sandbox-bypassed git call.

Updated Sep 3, 2026
One-click install
npx skills add https://github.com/CMiller838/meal-planner --skill git-push-main-cmiller838
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-push-main
Source: https://github.com/CMiller838/meal-planner/tree/main/.claude/skills/git-push-main
Command: npx skills add https://github.com/CMiller838/meal-planner --skill git-push-main-cmiller838

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? In sandboxed environments where Bash writes to certain paths and network egress are denied, a plain git add / git commit / git push sequence fails partway or wastes a round trip on retry. This Skill commits and pushes to main in a single bypassed call, avoiding partial failures and corrupted stash states. ## Core Features & Use Cases - One-shot commit and push: Bundles git commit and git push origin main with && in a single sandbox-bypassed Bash call, avoiding duplicate confirmation prompts. - Safe staging discipline: Reviews git status and git diff first and stages specific files rather than blindly running git add -A, catching secrets or unintended files. - Push rejection handling: On non-fast-forward rejection, fetches and shows upstream commits so the user decides whether to rebase or merge, never force-pushing. - Use Case: After editing files under .claude/skills/ in a repo where sandboxed writes and network access are denied, ask to push the changes and the commit-plus-push completes in one step instead of failing and retrying. ## Quick Start Commit my current changes and push them to main in one step.

Frequently Asked Questions about git-push-main

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

FAQPage Schema
How do I commit and push to main in one git command?

Chain the commands with && so the push only runs after a successful commit: git commit -m "message" && git push origin main. Bundling them in one shell call avoids a second confirmation prompt and latency round trip.

Why does git push fail inside a sandboxed environment?

Sandboxes often deny network egress and writes to protected paths, so git push cannot reach the remote and git add may fail on restricted directories. Running the command with the sandbox disabled resolves both issues in one call.

Should I use git add -A before committing?

Avoid blindly staging everything with git add -A. Review git status and git diff first, then stage only the specific files belonging to the change, which prevents accidentally committing secrets or unintended files.

What should I do when git push is rejected as non-fast-forward?

Do not force-push. Run git fetch and git log HEAD..origin/main --oneline to inspect the upstream commits, then let the user decide whether to rebase, merge, or take another approach.

When should I not use this direct-to-main push workflow?

Do not use it for pull requests or branches other than main, and never use git stash in this repo since it can silently corrupt the working tree. Use git diff or git show to inspect prior state instead.