Push local commits to the remote repository.
Current repository status
!`git status`
Commits to push
!`git log @{u}..HEAD --oneline 2>/dev/null || git log --oneline -5`
Steps
- Based on the above
git statusdetermine:- If there are uncommitted changes → notify the user that there are uncommitted changes (reminder only, continue execution)
- Based on the above "Commits to push" determine:
- If there are no commits to push → notify the user that there are no commits to push,end immediately
- Determine the push target:
- If
$ARGUMENTSis provided → usegit push $ARGUMENTS - Otherwise → use
git push
- If
- The Bash tool must be calledExecute the push command (simulated output is prohibited)
- Show the push result to the user
Output
Directly show the real Bash output; do not manually concatenate or simulate.