A highly opinionated CLI for creating GitHub pull requests with a consistent structure and automatic related PR tracking.
- detects or prompts for a ticket/tag
- suggests or prompts for a base branch
- opens one editor buffer seeded from a PR template
- creates the PR through
gh - updates the "Related PRs" section across matching PRs
The authoring flow is intentionally simple: no form fields, no placeholder prompts, one editable PR body.
git clone https://github.com/IAmRadek/git-pr.git
cd git-pr
cargo install --path .ghinstalled and authenticated- a git repository with at least one commit on the current branch
Default config path:
~/.config/git-pr/config.yaml
You can override the config directory with --config or GIT_PR_CONFIG.
Generate a default config:
git-pr --initExample:
jira:
url: "https://yourcompany.atlassian.net/browse/"
github:
user: "your-username"
default_reviewers:
- teammate1
- teammate2
template:
path: "/absolute/path/to/pull_request_template.md"
body: |
Related PRs:
<!-- RELATED_PR -->
<!-- /RELATED_PR -->
## Summary
## Changes
## Testing
markers:
related_pr_start: "<!-- RELATED_PR -->"
related_pr_end: "<!-- /RELATED_PR -->"The initial PR body is resolved in this order:
.github/PULL_REQUEST_TEMPLATE.mdin the current repositorytemplate.pathfrom configtemplate.bodyfrom config
Before the resolved template content, git-pr prepends ticket context, for example:
Ticket: TRACK-123
Jira: https://yourcompany.atlassian.net/browse/TRACK-123
If the resolved template does not already contain the related-PR marker block, git-pr also prepends:
<!-- RELATED_PR -->
<!-- /RELATED_PR -->
That prepended block is only a convenience. You can move or copy it anywhere in the template once the editor opens.
Create a PR:
git-prThe flow is:
- detect or select the ticket
- select the base branch
- edit the full PR body in your editor
- optionally select reviewers
Update related PRs only:
git-pr --update-onlyDry run:
git-pr --dry-runRelated PR updates only touch the configured marker section:
<!-- RELATED_PR -->
<!-- /RELATED_PR -->
If those markers exist in the PR body, git-pr rewrites that block with links to matching PRs. The rest of the body is left as authored.
src/
├── app.rs
├── cli.rs
├── config.rs
├── error.rs
├── git.rs
├── github.rs
├── jira.rs
├── lib.rs
├── main.rs
├── pr.rs
├── tags.rs
├── template.rs
└── ui.rs
MIT License. See LICENSE.