default commit message for a tree
- From
Steve French <smfrench@gmail.com>
- Date
- Apr 26, 2008, 01:39 UTC
- Message-ID
- <524f69650804251839u56198808o8b7a66d9894fbbfc@mail.gmail.com>
What needs to be done to setup a default commit message in git?
I did the following, trying to setup a default commit message (to get the equivalent of what I used to have with cg-commit in the past where 1/2 of my commit text was filled in automatically from a file in my tree ie default signed off line etc...
What I tried: First I did
git-config commit.template commit-templatewhich changed the .git/config to add new "[commit]" section (see below:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master[commit]
template = commit-templateI created a file .git/commit-template with default text as follows:
[CIFS]
Signed-off-by: Steve French <sfrench@us.ibm.com>
Now doing a "git commiit -a" though does not show this text. It just shows the typical empty default message in vi e.g.
# Please enter the commit message for your changes. # (Comment lines starting with '#' will not be included) # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: fs/cifs/CHANGES ....
-- Thanks, Steve