Pull requests

Write the title and description for your branch, and open it.

On a feature branch, gitmit pr writes a pull request title and description from the branch's commits and its overall diff:

$ gitmit pr

  3 commits on feat/password-reset, compared with origin/main

  Pull request
  feat(auth): add password reset via emailed link

  ## Summary
  Users who forget their password can now request a reset link by email.
  The link expires after an hour and can only be used once.

  ## Changes
  - Add `POST /auth/reset` and `POST /auth/reset/confirm`
  - Store hashed reset tokens with an expiry
  - Cover the happy path and expired tokens in tests

  ## How to test
  - Request a reset for an existing account and open the emailed link
  - Try the same link twice; the second attempt is rejected

  ● What next?
  │ ● Create the pull request on GitHub
  │ ○ Create it as a draft
  │ ○ Copy to clipboard
  │ ○ Edit in your editor
  │ ○ Write a new version
  │ ○ Done
  • The base branch is the remote's default branch (origin/HEAD), falling back to main or master. Pick another with --base develop.
  • The title follows the same rules as a commit header: your types, scopes, length limit, ticket ID and commitlint config. When the pull request is squash-merged, it becomes a good commit message.
  • Your template is used. If the repository has a pull request template (.github/pull_request_template.md, in the root, in docs/, or in .github/PULL_REQUEST_TEMPLATE/), gitmit fills it in instead of using its own sections.
  • Creating the pull request uses GitHub's CLI. gitmit pr --create pushes the branch (setting its upstream if needed) and runs gh pr create. If a pull request is already open for the branch, use gitmit pr --update to replace its title and description. Without gh, copy the text instead.
  • Offline, the title comes from the rules and the description lists the branch's commits.
  • Secrets are scanned for before anything is sent, exactly as for commits. Use --redact to send a redacted version instead of stopping.