Occasionally I will drop into troubleshooting mode and commit/push a number of small but separate commits with a comment like, \"Troubleshooting the
I'm not sure of how you can have a certain set of git commits use the last git comment you had entered, but you can set a default commit message. That could do the trick as long as you unset the default commit message once you're done with all the commits that needed to use that message.
Here's how you go about setting a default commit message. First, enter the desired commit message in a file, lets call it ~/LastCommitMessage.txt
. Then, specify this as your default (global) commit message like so:
$ git config --global commit.template ~/LastCommitMessage.txt
You could narrow the scope by not using --global and using something else instead.
You can easily access all git settings by opening up the .gitconfig
file located in your home directory. Open up that file and delete the setting above to unset it once you're done with all your commits.