Is there a simple way to have default text pre-populate in the comment buffer when commiting code with magit?
Asked
Active
Viewed 1,386 times
9
-
3Are you looking for some static piece of text that is the same for every commit? Or something derived from the staged changes in some way? – glucas Jan 30 '15 at 18:51
-
@qhfgva could you please help us help you by answering our questions. Or does one of existing answers already address your issue? Then you should accept it. – tarsius Mar 11 '15 at 10:14
2 Answers
7
If what you're looking for, is a default template message for a commit, you can put this in your .gitconfig
file:
[commit]
template = /path/to/a/.gitcommitmessagetemplate.txt
And inside .gitcommitmessagetemplate.txt, put whatever you want, example:
type scope: subject
Body
Breaking changes with description of the change, justification
and migration notes.
Closes|Refs #
4
You want magit-commit-add-log
, probably.
- navigate to a staged hunk
- call
magit-commit-add-log
. It used to be bound to C. You'll get a Changelog-style entry related to the current hunk's function in the commit message.

abo-abo
- 13,943
- 1
- 29
- 43