Tay Ray Chuan home archive

git commit --amend without launching editor, aka silent/quiet mode

Fri, 1 Mar 2013 18:06:03 +0800 | Filed under git

Today I learnt: you can do this by adding --no-edit to the invocation.

I learnt it the hard way: scanning the manpage from start to end. As the "false" symbiont to --edit, defined via OPT_BOOL, you won't have much success grepping --no-edit through the source either.

The curious developer might go one step further and ask: why --no-edit? Why not --amend=silent (which I thought of adding)?

It turns out that the --no-edit option is not only useful for --amend (although the manpage might suggest otherwise), you could conceivably use it for --squash, and, uh, and <insert multitude ways you can use git-commit>

blog comments powered by Disqus