Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: use "commit --cleanup=whitespace" with "rebase --interactive"

Tags:

git

I want to always use --cleanup=whitespace when creating/editing commit messages (to allow for initial "#"). Unfortunately, I can't find a proper setting to put in ~/.gitconfig; this one doesn't work:

[commit]
    cleanup = whitespace

For normal commits I added --cleanup=whitespace to my main commit alias, but I can't figure out how to pass this option to git rebase --interactive so that I could reword and squash commits and use my preferred cleanup method.

like image 766
Maciej Konieczny Avatar asked Apr 02 '12 13:04

Maciej Konieczny


1 Answers

In git 1.8.2 they added the setting I was trying to use:

"git commit" can be told to use --cleanup=whitespace by setting the configuration variable commit.cleanup to 'whitespace'.

Meanwhile, I just started adding a single space before a #...

like image 105
Maciej Konieczny Avatar answered Oct 19 '22 20:10

Maciej Konieczny