Skip to content

Instantly share code, notes, and snippets.

@wdhowe
Created October 24, 2024 13:29
Show Gist options
  • Save wdhowe/5c0728d1e29a4640ce891609c020c2bc to your computer and use it in GitHub Desktop.
Save wdhowe/5c0728d1e29a4640ce891609c020c2bc to your computer and use it in GitHub Desktop.
Git: Pull Request CLI

Git: Pull Request CLI

Some github cli example commands to open pull requests.

Remove --dry-run to create.

With a Template

Opens a pull reqest to merge SOURCEBRANCH into DESTBRANCH, using a markdown formatted template for the body.

gh pr --repo USERHERE/myrepo create \
--head SOURCEBRANCH --base DESTBRANCH \
--title "Pull Request Title Here" \
--template pull_request_template.md \
--reviewer USERHERE --draft --dry-run

Without a Template

Opens a pull reqest to merge SOURCEBRANCH into DESTBRANCH.

gh pr --repo USERHERE/myrepo create \
--head SOURCEBRANCH --base DESTBRANCH \
--title "Pull Request Title Here" \
--body "Pull request body here." \
--reviewer USERHERE --draft --dry-run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment