Skip to contentSkip to conversation

Question: git commit -v uncomment Changes to be commited

DISCUSSION mike.gaffney 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I find myself always uncommenting the "Changes to be commited:" section on a git commit -v. Other than a nifty regex with vi, I'm wondering if there is a way to customize the unified diff that is created with commit -v. I've looked through the list, but it is one of those things where I don't really know how to ask the question (phrase the search). I would be glad of any help that people could give me.

Thanks,
Mike Gaffney

#1 lore raw
Quoted 6 lines · mike.gaffney

I find myself always uncommenting the "Changes to be commited:" section on a git commit -v. Other than a nifty regex with vi, I'm wondering if there is a way to customize the unified diff that is created with commit -v. I've looked through the list, but it is one of those things where I don't really know how to ask the question (phrase the search). I would be glad of any help that people could give me.

You probably want to edit the hook .git/hooks/prepare-commit-msg in your repository. Don't forget to enable it with chmod +x.

More information at:
http://www.kernel.org/pub/software/scm/git/docs/githooks.html

Olivier.