Skip to main content

Creating a pull request template for your repository

When you add a pull request template to your repository, project contributors will automatically see the template's contents in the pull request body.

For more information, see "About issue and pull request templates."

You can create a PULL_REQUEST_TEMPLATE/ subdirectory in any of the supported folders to contain multiple pull request templates, and use the template query parameter to specify the template that will fill the pull request body. For more information, see "Using query parameters to create a pull request."

You can create default pull request templates for your organization or personal account. For more information, see "Creating a default community health file."

Adding a pull request template

  1. On GitHub.com, navigate to the main page of the repository.
  2. Acima da lista de arquivos, usando o menu suspenso Adicionar arquivo, clique em Criar arquivo. "Criar arquivo" no menu suspenso "Adicionar arquivo"
  3. In the file name field:
    • To make your pull request template visible in the repository's root directory, name the pull request template pull_request_template.md. New pull request template name in root directory
    • To make your pull request template visible in the repository's docs directory, name the pull request template docs/pull_request_template.md. New pull request template in docs directory
    • To store your file in a hidden directory, name the pull request template .github/pull_request_template.md. New pull request template in hidden directory
    • To create multiple pull request templates and use the template query parameter to specify a template to fill the pull request body, type .github/PULL_REQUEST_TEMPLATE/, then the name of your pull request template. For example, .github/PULL_REQUEST_TEMPLATE/pull_request_template.md. You can also store multiple pull request templates in a PULL_REQUEST_TEMPLATE subdirectory within the root or docs/ directories. For more information, see "Using query parameters to create a pull request." New multiple pull request template in hidden directory
  4. In the body of the new file, add your pull request template. This could include:
    • A reference to a related issue in your repository.
    • A description of the changes proposed in the pull request.
    • @mentions of the person or team responsible for reviewing proposed changes.
  5. No final da página, digite uma mensagem de commit curta e significativa que descreva a alteração feita no arquivo. Você pode atribuir o commit a mais de um autor na mensagem de commit. Para obter mais informações, confira "Como criar um commit com vários coautores". Mensagem de commit para a alteração
  6. Abaixo dos campos de mensagem do commit, opte por adicionar o commit ao branch atual ou a um novo branch. Se seu branch atual for o branch-padrão, você deverá optar por criar um novo branch para seu commit e, em seguida, criar um pull request. Para obter mais informações, confira "Como criar uma solicitação de pull". Opções de commit no branch Templates are available to collaborators when they are merged into the repository's default branch.
  7. Clique em Propor novo arquivo. Botão Propor novo arquivo

Further reading