Let's say I'm working on a branch and I run git commit
. I am then taken to the commit message prompt where I may enter a commit subject and message. What I'm looking for is a way to have the commit subject pre-populated while still being able to write the commit message manually.
This question is distinct from this one in that I want the commit subject to be populated but still want to be prompted to enter a commit message, i.e. running git commit -a
in git bash results in something like:
Edit: improper usage of githooks was preventing the accepted answer from the linked question from working. So, the questions are not distinct and this can be marked as a duplicate.
I'm currently trying to pre-populate the commit subject with a branch name, but in the future I may want that text to be something else. As such, a general solution (not specifically for branch names) would be preferred.