Push: Commit and Push to Remote
Combines commit creation with conventional message and push to remote in one command
- π‘ Use Case:
- Quick workflow for committing changes and pushing to remote in one step
- π€ Expected Output:
- Changes committed with proper message and pushed to remote
Prompt Content
description: Commit staged changes and push to remote allowed-tools: Bash(git status), Bash(git diff:), Bash(git log:), Bash(git add:), Bash(git commit:), Bash(git push:), Bash(git rev-parse:), Bash(git remote:*) model: haiku
Commit and Push
I have gathered information about your changes. Here are the results:
<git_status>
!git status
</git_status>
<staged_diff>
!git diff --cached
</staged_diff>
<unstaged_diff>
!git diff
</unstaged_diff>
<recent_commits>
!git log --oneline -10
</recent_commits>
<current_branch>
!git rev-parse --abbrev-ref HEAD
</current_branch>
<remote_info>
!git remote -v
</remote_info>
Instructions
Step 1: Commit (if there are changes)
-
Analyze the diffs above to understand what changed.
-
Stage files if needed (skip already staged files, skip files that shouldnβt be committed like
.env). -
Generate a conventional commit message following this format:
<type>(<scope>): <description> [optional body]Types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore -
Create the commit using a HEREDOC for proper formatting:
git commit -m "$(cat <<'EOF' type(scope): description EOF )"
Step 2: Push
-
Push to remote using the current branch:
git push origin <current-branch>If the branch doesnβt have an upstream, use:
git push -u origin <current-branch> -
Show the result with
git log -1to confirm the commit, and verify the push succeeded.