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

Please enter a commit message

Solution

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”

This happens when a commit was made to the branch you are working with an you try to push a commit (git push) before pulling the changes (git pull)

1- How to solve this:

2- Press “i” on your keyboard.

3- Write your merge message

4- Press “esc” button

5- Type “:wq”

6- Press Enter

Finally, Push Changes “git push”

Default image
Navjot Singh Virk
Navjot is a Hobby Blogger from Ireland and loves to create content to help people. He makes time on weekends to work on this blog. And has a full time position at Verizon Media as Lead Technical Solutions Consultant, which he loves and thrives at. His Skills include in-depth knowledge of SEO, Javascript, Advertising, HTML and Java. And his other hobbies include Investing, Gardening and playing Table Tennis.