1

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?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks, it solved the issue. I guess I need to recheck my config.
vim --clean is a newer way to do the same thing.

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.