News for hackers. Stuff that matters.
Re:Beej's Guide to Git by alexjm on Wednesday February 05, 2025 @12:41PM (#42952186)
The minor difference is that :q! quits without saving but returns zero as the exit code, but :cq quits with a nonzero exit code. Git interprets the nonzero exit code as "editing failed", following the Unix convention that zero means success. If you didn't save the commit message while working on it, :q! will send the empty template back to Git, which Git is smart enough to not commit. But if you accidentally save your work partway through, :q! will still commit the message you wanted to abandon.

There are no comments on this comment yet.