Diese Version von GitHub Enterprise wurde eingestellt am 2021-09-23. Es wird keine Patch-Freigabe vorgenommen, auch nicht für kritische Sicherheitsprobleme. Für eine bessere Leistung, verbesserte Sicherheit und neue Features nimm ein Upgrade auf die neueste Version von GitHub Enterprise vor. Wende Dich an den GitHub Enterprise-Support, um Hilfe beim Upgrade zu erhalten.

Using query parameters to create a pull request

Use query parameters to create custom URLs to open pull requests with pre-populated fields.

You can use query parameters to open pull requests. Query parameters are optional parts of a URL you can customize to share a specific web page view, such as search filter results or a pull request template on GitHub. Um eigene Abfrageparameter zu erstellen, musst Du Schlüssel- und Wertepaar abgleichen.

Tip: You can also create pull request templates that open with default labels, assignees, and an pull request title. For more information, see "Using templates to encourage useful issues and pull requests."

Du musst die erforderlichen Berechtigungen für jede Aktion haben, um den entsprechenden Abfrageparameter zu verwenden. For example, you must have permission to add a label to a pull request to use the labels query parameter. Weitere Informationen findest Du unter„Berechtigungsebenen für die Repositorys einer Organisation.“

If you create an invalid URL using query parameters, or if you don’t have the proper permissions, the URL will return a 404 Not Found error page. If you create a URL that exceeds the server limit, the URL will return a 414 URI Too Long error page.

AbfrageparameterBeispiel
quick_pullhttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1 creates a pull request that compares the base branch main and head branch my-branch. The quick_pull=1 query brings you directly to the "Open a pull request" page.
titlehttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1&labels=bug&title=Bug+fix+report creates a pull request with the label "bug" and title "Bug fix."
Texthttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1&title=Bug+fix&body=Describe+the+fix. creates a pull request with the title "Bug fix" and the comment "Describe the fix" in the pull request body.
labelshttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1&labels=help+wanted,bug creates a pull request with the labels "help wanted" and "bug".
Meilensteinehttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1&milestone=testing+milestones creates a pull request with the milestone "testing milestones."
assigneeshttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1&assignees=octocat creates a pull request and assigns it to @octocat.
projectshttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1&title=Bug+fix&projects=octo-org/1 creates a pull request with the title "Bug fix" and adds it to the organization's project board 1.
Vorlagehttps://github.com/octo-org/octo-repo/compare/main...my-branch?quick_pull=1&template=issue_template.md creates a pull request with a template in the pull request body. The template query parameter works with templates stored in a PULL_REQUEST_TEMPLATE subdirectory within the root, docs/ or .github/ directory in a repository. For more information, see "Using templates to encourage useful issues and pull requests."