.nh .TH "GT-PR-MERGE" "1" "Nov 2026" "gitea-cli" "gitea-cli Manual" .SH NAME gt-pr-merge - Merge a pull request .SH SYNOPSIS \fBgt pr merge [ | | ] [flags]\fP .SH DESCRIPTION Merge a pull request on Gitea. .PP Without a method, gt uses the repository's default merge style. On a terminal, leaving out the method or --delete-branch asks for them, preselecting the repository's defaults. With --delete-branch, gt also deletes the local head branch when it is checked out, switching to the base branch. .PP --delete-branch deletes the head branch of a pull request from a fork too, when you can push to that fork: your own, or any as a site administrator. A fork you cannot push to keeps it. .PP For a pull request merged outside Gitea, such as with git merge and git push, --method manually-merged --commit SHA marks it as merged by that commit of the base branch. The repository must allow it (gt repo edit --allow-manual-merge). Gitea does not check that the commit contains the pull request's changes. .PP --admin merges although the branch protection is not met, if Gitea lets you bypass the branch protection. --match-head-commit SHA merges only while the head of the pull request is still that commit, so a push after you reviewed it is not merged unseen; otherwise gt exits with 6. Neither can be combined with --auto, as a scheduled merge does not keep them. --disable-auto cancels the merge that --auto scheduled, and merges nothing. .SS ARGUMENTS .EX A pull request can be supplied as argument in any of the following formats: - by number, such as "13" or "#13" - by URL, such as "https://gitea.com/OWNER/REPO/pulls/13" - by the name of its head branch, such as "feature/login" or "bob:feature/login"; a branch that reads as OWNER/REPO#N, such as "fix/login#2", needs the OWNER:BRANCH form Without an argument, the pull request of the current branch is selected. .EE .SS JSON FIELDS .EX assignees, author, base, body, comments, created_at, draft, due_date, head, head_remote_deleted, head_repo, head_sha, id, labels, merge_commit_sha, mergeable, merged, merged_at, merged_by, milestone, number, review_decision, reviewer_teams, reviewers, reviews, state, title, updated_at, url .EE .SH OPTIONS \fB--admin\fP[=false] Merge although the branch protection is not met, if Gitea lets you bypass the branch protection .PP \fB--auto\fP[=false] Merge once the required checks succeed .PP \fB--commit\fP="" Commit \fBsha\fR on the base branch that merged the pull request outside Gitea (with --method manually-merged) .PP \fB-d\fP, \fB--delete-branch\fP[=false] Delete the head branch on Gitea and locally after merging (default: the repository setting, on Gitea only) .PP \fB--disable-auto\fP[=false] Cancel the merge that --auto scheduled, and merge nothing .PP \fB--dry-run\fP[=false] Show the write requests gt would send, without sending them .PP \fB-e\fP, \fB--editor\fP[=false] Write the merge commit message in your editor .PP \fB-h\fP, \fB--help\fP[=false] help for merge .PP \fB--match-head-commit\fP="" Merge only if the head of the pull request is this commit \fBsha\fR .PP \fB--merge\fP[=false] Create a merge commit .PP \fB-b\fP, \fB--message\fP="" Merge commit message .PP \fB-F\fP, \fB--message-file\fP="" Read the merge commit message from \fBfile\fR, or - for stdin .PP \fB-s\fP, \fB--method\fP="" Merge method (default: the repository's default merge style) {merge|rebase|rebase-merge|squash|fast-forward-only|manually-merged} .PP \fB--rebase\fP[=false] Rebase the commits onto the base branch .PP \fB--squash\fP[=false] Squash the commits into one commit and merge it .PP \fB-t\fP, \fB--title\fP="" Merge commit title .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB--csv\fP[=""] Output CSV with the specified comma-separated \fBfields\fR, or all fields .PP \fB--cwd\fP="" Working \fBdirectory\fR for repository discovery .PP \fB--debug\fP[=false] Log the method, URL, status, and duration of each HTTP request to stderr .PP \fB--host\fP="" Gitea instance \fBURL\fR, including any base path .PP \fB--interactive\fP[=false] Allow prompts with machine output .PP \fB-q\fP, \fB--jq\fP="" Filter JSON output using a jq \fBexpression\fR; implies --json .PP \fB--json\fP[=""] Output JSON with the specified comma-separated \fBfields\fR, or all fields .PP \fB--no-input\fP[=false] Disable prompts and implicit editor/browser interactions .PP \fB--remote\fP="" Git \fBremote\fR used for repository discovery .PP \fB-R\fP, \fB--repo\fP="" Select a repository as \fBOWNER/REPO\fR or URL .PP \fB--sudo\fP="" Perform API requests as this \fBuser\fR (requires an administrator account) .PP \fB--template\fP="" Format JSON output using a Go \fBtemplate\fR; implies --json (see gt help formatting) .PP \fB--user\fP="" Account \fBname\fR on the selected instance .PP \fB-y\fP, \fB--yes\fP[=false] Accept confirmations without prompting .SH EXAMPLE .EX # Merge the pull request of the current branch with the repository's default style $ gt pr merge # Squash #13 and delete its branch $ gt pr merge 13 --squash --delete-branch # Merge once the checks pass, without prompts $ gt pr merge 13 --auto --yes # Merge only the commit that was reviewed, and cancel a scheduled merge $ gt pr merge 13 --squash --match-head-commit 4b825dc $ gt pr merge 13 --disable-auto # Mark #13 as merged by a commit pushed to the base branch outside Gitea $ gt pr merge 13 --method manually-merged --commit 4b825dc --delete-branch .EE .SH SEE ALSO \fBgt-pr(1)\fP