Re: why does "git revert" commit even if i try to bail with ":q!"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 12 Mar 2019, Kevin Daudt wrote:

... snip ...

> The only reason why `:q!` works just for comitting is because there
> is no default message, so the final message ends up empty.
>
> When you do things like git revert or git commit --amend, there is
> already a commit message, which you are then editing. When you quit
> without saving, the existing message remains and git uses that.
>
> vim has a command to let it exit with an error return code: `:cq`.
> This makes git something went wrong with editing the message,
> causing git to abort the commit.

  ah, i'm starting to get it. predictably, i think this needs to be
mentioned in a man page. :-) thanks muchly for clearing that up.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux