1

I've seen answers that show how you can change the default git commit message, but I simply want to prepend the entire message and maintain the commented note highlighting the files to be committed. The prepended message would be of this format and the user would add a note before finalizing the commit.

<issue number from branch> 

Closes <issue number from branch>

Can I do this with prepare-commit-msg hook?

JIRA-123

Closes JIRA-123

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch feature/JIRA-123/update_changelog
# Changes to be committed:
#       modified:   CHANGES.rst
#
TomNash
  • 3,147
  • 2
  • 21
  • 57
  • 1
    Does this answer your question? [How to add Git's branch name to the commit message?](https://stackoverflow.com/questions/5894946/how-to-add-gits-branch-name-to-the-commit-message) – Nicolas Voron Mar 11 '20 at 14:40

0 Answers0