DEV Community

Akira
Akira

Posted on

1

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.

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay