The commit message is from Git, but it is actually the editor that keeps you from quitting. This is because Git uses your default editor, which for a variety of reasons is usually set to vi (it might be something else on your OS, like pico).

To write a commit message and get out of VI, follow these steps:

  1. press i (i for insert)
  2. write your merge message
  3. press esc (escape)
  4. write :wq (write & quit)
  5. then press enter

You can also configure Git to use another editor to avoid having to use VI (or its close cousin VIM).

Answer from Saad.elzwawy on Stack Overflow
🌐
Appuals
appuals.com › home › linux › linux troubleshooting
Fix: Please enter a commit message to explain why this merge is necessary
April 30, 2023 - Both lines of this message start ... many developers are working on a project, this is added so you can leave a message to others about why you merged an upstream into a topic branch....
🌐
CodeGenes
codegenes.net › blog › please-enter-a-commit-message-to-explain-why-this-merge-is-necessary-especially-if-it-merges-an-updated-upstream-into-a-topic-branch
Git Error: 'Please Enter a Commit Message to Explain Merge' – How to Exit Editor in Terminal (OS X)
The message “Please enter a commit message to explain why this merge is necessary” appears when Git performs a non-fast-forward merge. Unlike fast-forward merges (which simply move the branch pointer forward), non-fast-forward merges create ...
🌐
Brandon Pugh's Blog
brandonpugh.com › posts › tips for creating merge commits
Tips for creating merge commits | Brandon Pugh's Blog
August 31, 2024 - Merge branch 'main' into feature-branch # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch.
🌐
Mrvirk
mrvirk.com › home › how to fix ? please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch issue
How to Fix ? Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch issue - The Virk Report by Virk & Co.
May 4, 2026 - When trying to push a commit into Github via terminal we come across this problem: “Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch | Error Message”.
Find elsewhere
🌐
GitHub
github.com › gitkraken › vscode-gitlens › issues › 2440
GitLens does not remove comments from merge commit msg · Issue #2440 · gitkraken/vscode-gitlens
January 10, 2023 - Merge branch 'feature/BLA-296' into develop ; Please enter a commit message to explain why this merge is necessary, ; especially if it merges an updated upstream into a topic branch.
Author   gitkraken
🌐
Codez Up
codezup.com › home › resolve “please enter a commit message to explain why this merge is necessary..” | git issue
Resolve “Please enter a commit message to explain why this merge is necessary.." | Git Issue
August 11, 2021 - In this article, we will learn how to resolve the “Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch” message in Git.
🌐
Position Is Everything
positioniseverything.net › home › please enter a commit message to explain why this merge is necessary: sorted
Please Enter a Commit Message To Explain Why This Merge Is Necessary: Sorted
December 29, 2025 - Please enter a commit message to explain why this merge is necessary if it merges an updated upstream into a topic branch error might appear on OS X when your default editor doesn’t allow you to quit after entering the message.
🌐
Plain English
plainenglish.io › home › blog › github › fixing a common problem with a git merge
Fixing a common problem with a Git Merge
December 1, 2012 - Merge branch 'master' of ... a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch....
🌐
JavaScript in Plain English
javascript.plainenglish.io › problem-with-git-merge-please-enter-a-commit-message-to-explain-why-this-merge-is-necessary-854757988c17
Problem with a Git Merge: Please enter a commit message to explain why this merge is necessary | JavaScript in Plain English
June 7, 2020 - Merge branch 'master' of https://github.com/marieqg/netlify-cms-medium # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch.
🌐
University of Chicago
classes.cs.uchicago.edu › archive › 2018 › fall › 12100-1 › git-faq.html
Git FAQ — CS121 Main Page 1.0 documentation
Merge branch 'master' of mit.cs.uchicago.edu:cmsc12100-aut-18/cmsc12100-aut-18 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch.
🌐
University of Chicago
classes.cs.uchicago.edu › archive › 2021 › fall › 30121-1 › resources › faq.html
FAQ — CAPP 30121 - Computer Science with Applications I documentation
Merge branch 'main' of mit.cs.uchicago.edu:capp30121-aut-20/capp30121-aut-20 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch.
🌐
CS 61B Spring 2025
sp25.datastructur.es › troubleshooting › git-wtfs
Git WTFS | CS 61B Spring 2025
If, after pulling again, your terminal shows a message like “Please enter a commit message to explain why this merge is necessary,” see the section directly after this one.