pedrorijo91
pedrorijo91

Reputation: 7845

git commit with template message

is it possible to do a git commit and when the editor opens it is already filled with a message to be edited?

example:

git commit "some string"

would open the text editor with "some string" that could be edited.

Use case: I have a git alias to commit work in progress (end of the day for instance) git commit -m ":construction: WIP" (yes, I use emojis on some commit messages), but I would like to add some extra details sometimes.

For the git documentation there's:

Any solutions?

Upvotes: 0

Views: 1176

Answers (1)

Useless
Useless

Reputation: 67772

Use the -e|--edit option to allow manual editing even when you provide a message on the command line:

$ git commit -em ":construction: WIP"

This and many other options are described in the documentation

Upvotes: 3

Related Questions