- Remove homelab special-case from commit-push command (all repos now use origin) - Update sync-config to use origin remote instead of homelab - Enhance card generation with season-pct params, CLI reference, and validation fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
Commit all staged/unstaged changes, push to remote, and optionally create a PR.
This command IS explicit approval to commit and push — no need to ask for confirmation.
Arguments: $ARGUMENTS
If $ARGUMENTS contains "pr", also create a pull request after pushing.
Steps
- Run
git statusto see what has changed (never use-uall) - Run
git diffto see staged and unstaged changes - Run
git log --oneline -5to see recent commit style - If there are no changes, say "Nothing to commit" and stop
- Determine the remote name and current branch:
- Remote: use
git remote(if multiple, preferorigin) - Branch: use
git branch --show-current
- Remote: use
- Stage all relevant changed files (prefer specific files over
git add -A— avoid secrets, .env, credentials) - Draft a concise commit message following the repo's existing style (focus on "why" not "what")
- Create the commit with
Co-Authored-By: Claude <model> <noreply@anthropic.com>where<model>is the model currently in use (check your own model identity — e.g., Opus 4.6, Sonnet 4.5, Haiku 4.5) - Push to the remote with
-uflag:git push -u <remote> <branch> - Confirm success with the commit hash
If pr argument is present
After pushing, create a pull request:
- Detect the hosting platform:
- If remote URL contains
github.com→ usegh pr create - If remote URL contains
git.manticorum.comor other Gitea host → usetea pulls create
- If remote URL contains
- Determine the default branch:
git symbolic-ref refs/remotes/<remote>/HEAD | sed 's|.*/||'(fallback tomain) - Run
git log <default-branch>..HEAD --onelineto summarize all commits in the PR - Create the PR:
- GitHub:
gh pr create --base <default-branch> --title "Title" --body "..." - Gitea:
tea pulls create --head <branch> --base <default-branch> --title "Title" --description "..."
- GitHub:
- Include a summary section and test plan in the PR body
- Return the PR URL
Important
- This command IS explicit approval to commit, push, and (if requested) create a PR
- Do NOT ask for confirmation — the user invoked this command intentionally
- If push fails, show the error and suggest remediation
- Never force push unless the user explicitly says to
- If on
mainbranch andpris requested, warn that PRs are typically from feature branches