THE GITHTML FIELD GUIDE
Close a GitHub pull request without confusing it with a merge
Closing a pull request without merging ends that proposal’s active review; it does not integrate its code into the base branch. Explain the reason and link any replacement. Deleting the head branch is a separate decision, and reversing code that was already merged requires a separate corrective change or revert rather than simply closing the request.
Choose closure for the actual proposal outcome
A request may be superseded, abandoned, duplicated, or based on an approach the team rejected. Closing it can make the active queue clearer, but preserve the reasoning so future contributors do not repeat the same investigation. If the only problem is an incorrect base branch, changing the base may be more appropriate than creating a duplicate request.
Check whether the proposal has already been merged or whether some commits were incorporated through another route. A closed state alone does not explain how the code reached the base. Inspect the timeline and commit history before telling others that the work was either accepted or discarded. Content and collaboration state are related but distinct evidence.
Leave a concise closure record
Before closing, identify any useful discussion, tests, or partial implementation that should be retained. Link the replacement request or issue when one exists, and state what remains unresolved. Avoid a bare closed comment that forces future readers to reconstruct the decision from scattered messages.
- Example closure note: Superseded by the narrower parser fix in the linked request; this branch also contained an unrelated refactor that will be considered separately.
- If the work is merely paused, explain the restart condition and owner rather than implying the underlying problem is solved.
- Do not delete a head branch until you understand whether it contains unmerged follow-up work or is used by another open proposal.
Verify state and preserve recoverability
After closing, confirm the request is closed and the base branch has not changed as a consequence of closure itself. Branch cleanup, if appropriate, should be a separate reviewed action. Local clones can still hold the branch and commits, and closing a request is not a guarantee that sensitive content has been removed from history.
If the proposal was merged and later found faulty, prepare a new corrective change using the project’s rollback process. If another request depends on this branch, inspect that dependency before closing or deleting references. The useful outcome is a clear decision about the proposal with valuable context preserved, not simply reducing the number of open requests. Future readers should know what happened to both the discussion and the actual code.
- If a narrower replacement retains only part of the proposal, list the retained change and the deliberately omitted work in the closure note. Link the replacement’s actual scope. Future readers should not infer that every idea from the closed request shipped merely because another request superseded it.
- When the author plans to resume later, preserve a clear restart condition such as a dependency release or a design decision. Distinguish that pause from rejection of the approach. The closed request can retain useful discussion without implying that maintainers should continue spending review time on it now.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.