git:使用“commit --cleanup = whitespace”和“rebase --interactive”

时间:2012-04-02 13:41:29

标签: git

我想在创建/编辑提交消息时总是使用--cleanup=whitespace(以允许初始化“#”)。不幸的是,我无法找到适当的设置~/.gitconfig;这个不起作用:

[commit]
    cleanup = whitespace

对于正常提交,我将--cleanup=whitespace添加到我的主提交别名中,但是 我无法弄清楚如何将此选项传递给git rebase --interactive,以便我可以重新编写并压缩提交并使用我首选的清理方法。

2 个答案:

答案 0 :(得分:6)

git 1.8.2中,他们添加了我尝试使用的设置:

  

“git commit”可以通过设置来告诉使用--cleanup = whitespace   配置变量commit.cleanup为'whitespace'。

与此同时,我刚开始在# ...

之前添加一个空格

答案 1 :(得分:-1)

你的意思是这样吗?

[alias]
    rec = rebase --interactive
相关问题