Re: Query on git commit amend
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Dec 6, 2011, 09:11 UTC
- Message-ID
- <4EDDDC38.8080108@viscovery.net>
- In-Reply-To
- <4EDDD0E4.6040003@st.com>
Am 12/6/2011 9:23, schrieb Viresh Kumar:
Show 20 quoted lines
> > Hello, > > Suppose i want to add few new changes to my last commit (HEAD). > The way i do it is > $ git add all_changed_files > $ git commit --amend > > OR > $ git commit --amend -a > > With both these ways, i get a screen to edit the message too. > > I want to know if there is a way to skip this screen. > > i.e. > $ git commit --amend -a -some_other_option > > which simply adds new changes to existing commit, without asking to change > message.
$ git commit --amend -a -C HEAD
But let's count keystrokes (after -a):
<BLANK>-<SHIFT>C<BLANK>HEAD<ENTER> 10 keystrokes (more if you release SHIFT before D)
But if vi pops up you have:
<ENTER><SHIFT>ZZ 4 keystrokes
Where is the advantage of the option?
-- Hannes