CyberGuy
CyberGuy

Reputation: 2813

GIT commit --amend always removes first line in commit-message in VIM

git commit --amend

Always removes me first line from commit-message. My editor is VIM.

Do you have guys any idea what could be the reason for that?

Upvotes: 1

Views: 135

Answers (1)

okket
okket

Reputation: 2320

Without knowing your VIM configuration it is hard to tell. But you can test running a git commit --amend using VIM without any configuration this way:

GIT_EDITOR="vim --noplugin -u NONE" git commit --amend

This is one line in the shell and instructs git to use VIM without configuration only for this invocation via the environment variable. If this leave the commit message intact and does not remove the first line, you have to go through your VIM configuration what could possibly cause this.

Upvotes: 3

Related Questions