How to Set a Default Commit Message

By  on  

Having a default commit message is really useful for a number of reasons:

  • It can formalize your commit messages
  • It serves as a good reminder for the information you should add to your commit message, like issue number
  • If you set it to "Drunk AF, don't accept this"

To set a default commit message on your local machine, start by executing the following from command line:

git config --global commit.template ~/.gitmessage

This tells your local git config to pull the text from ~/.gitmessage as the default commit message. You could set the text to something like:

Fix Issue #{number}: {description}

R+: {reviewer}

Of course, if you set your commit message via git commit -m {description}, the default will not be used, so it's a win-win!

Recent Features

Incredible Demos

  • By
    Fix Anchor URLs Using MooTools 1.2

    The administrative control panel I build for my customers features FCKEditor, a powerful WYSIWYG editor that allows the customer to add links, bold text, create ordered lists, and so on. I provide training and documentation to the customers but many times they simply forget to...

  • By
    Create Digg URLs Using PHP

    Digg recently came out with a sweet new feature that allows users to create Tiny Digg URLs which show a Digg banner at the top allowing easy access to vote for the article from the page. While I love visiting Digg every once in a...


    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!