DEV Community

Akira
Akira

Posted on

Self-note: Try this to write a commit message when you're stuck in VIM

Maybe this will help you.

When git pulling master into a feature branch, you may get this error:

Merge branch 'master' of xxxxxxxx into xxxxxxxxx

Please enter a commit message to explain why this merge is necessary,

especially if it merges an updated upstream into a topic branch.

Ah, stuck in VIM.

Here's what I did. It seemed to work.

cntrl x + cntrl v + commit message + :wq

If that doesn't help, try this thread from stackoverflow https://stackoverflow.com/questions/19085807/please-enter-a-commit-message-to-explain-why-this-merge-is-necessary-especially

godspeed

Top comments (3)

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Best way to exit vim:

  • Spam Escape a bunch of times
  • :xa to save all work and exit
  • qa! to discard all changes and exit

(or, you know, one of the many funny alternatives)

Collapse
 
akiramakes profile image
Akira

ahhhh :xa worked! you're a godsend.

Collapse
 
akiramakes profile image
Akira

Thank you!! This git repo is simultaneously hilarious and terrifying. :D Good find.