2

git commit has a --no-edit flag which will "use the selected commit message without launching an editor".

For example, when git merge produces conflicts, after these have been resolved running git commit --no-edit will commit without opening the editor, using to the default merge commit message.

I want a way to permanently enforce this behaviour so I don't have to specify --no-edit each time I run git commit.

I can find an equivalent setting for git merge, but nothing for git commit.

1 Answer 1

1

For git commit the --no-edit option only makes sense if there is a "selected commit message". In case of committing a merge conflict resolution or when being used together with --amend it's clear that the selected commit message is the one of the merge commit or the commit to amend to. But in the regular case of using git commit to create a new commit, you have to specify a commit message (unless --allow-empty is used), hence you have to use an editor. So as the use cases for git commit --no-edit are rather limited, I'm not aware of a permanent configuration setting for that behavior. In any case, you could define your own alias for it.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.