Friday, May 13, 2016

Adding a git commit template

So I find myself constantly forgetting to add the jira ticket number to commits that need them.

echo JIRA >~/txt/git-commit-template.txt

And one of these commands

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

or put in in .git/config (per repo) or $HOME/.gitconfig (global):

    [commit]
            template = /Users/mh/txt/git-commit-template.txt


Don't forget to manage your git commit template in git!

blogodex = {"toc" : "git", "idx" : "commit template"};