2

I am trying to enter the Git commit message in the editor which looks like Vi, but none of commands like :wq, Esc etc. are working. Whenever I try to merge the master branch, this window pops up:

Merge branch 'master' into awesomebar

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.



--**-Mg: MERGE_MSG                        (fundamental)----All-------------------

And the cursor stays right at the beginning of the sentence Merge branch 'master' into awesomebar. Neither can I move the cursor, neither can I exit. Typing Esc gives the following commands:

Merge branch 'master' into awesomebar

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.



--**-Mg: MERGE_MSG                        (fundamental)----All-------------------
ESC-

And once I type something, I can't even delete it. How do I deal with this?

9
  • You trying to navigate with the keyboard or the mouse? Commented May 7, 2018 at 9:13
  • keyboard offcourse. but typing arrow keys give [c at the beggining Commented May 7, 2018 at 9:14
  • Try changing your default git editor to vim git config --global core.editor vim Commented May 7, 2018 at 9:17
  • I assume its Vi editor. Can we do something with the vi editor? Commented May 7, 2018 at 9:17
  • I think you are just neglecting to enter insert mode. Commented May 7, 2018 at 9:21

2 Answers 2

1

It looks like to be Joe

From what I know to save and exit you must type ^kx (where ^ is equal to CTRL).

If you want to change default Git's editor, just update the EDITOR variable, in your ~/.bashrc by example:

export EDITOR="vim"
Sign up to request clarification or add additional context in comments.

Comments

0

The (fundamental) line is a hint that this is some kind of Emacs: Fundamental mode is one of the Major Modes of Emacs.

This is the documentation for the basic usage of Emacs:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.