| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
| description | Create or update a GitHub pull request from the current branch |
|---|
Create or update a pull request for the current branch. Generates a title from the changes and lists commits in the description. Breaking changes are highlighted.
Only run commands listed in allowed_commands. Never run commands in forbidden_commands or any command that modifies files, branches, or commit history.
git rev-parse --abbrev-ref HEAD
gh pr list --head "$(git rev-parse --abbrev-ref HEAD)" --json number,url,state --jq '.[] | select(.state == "OPEN")'git fetch origin
git rebase origin/maingit status --porcelain
git log @{upstream}..HEAD --oneline 2>/dev/nullgit push --force-with-lease -u origin HEADImportant: git log main..HEAD is unreliable when previous PRs were squash-merged — it will include commits whose changes are already on main. Instead, use git cherry to find only commits not yet merged:
git cherry -v origin/main HEADThis outputs lines prefixed with + (unmerged) or - (already merged). Only use + lines. The format is + <sha> <subject>.
For each unmerged commit, get the full details:
git log <sha> -1 --format='%s%n%b%n---'Parse each commit:
Analyze all commit subjects to produce a concise PR title:
Construct the body using this structure:
## Changes - <commit subject 1> - <commit subject 2> - ...
If any commits are breaking, add a section:
## Breaking Changes - <breaking commit subject>: <explanation from commit body if available>
Do NOT include merge commits or fixup commits in the list.
If no open PR exists (from Step 1):
gh pr create --base main --title "<title>" --body "$(cat <<'EOF'
<body>
EOF
)"If an open PR already exists:
gh pr edit <number> --title "<title>" --body "$(cat <<'EOF'
<body>
EOF
)"Output the PR URL and a brief summary:
PR <created|updated>: <url> Title: <title> Commits: <count> Breaking changes: <count or "none">
| Back | FazBrowse Home | New Git URL |