git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git versus CVS (versus bk)

From
Junio C Hamano <junkio@cox.net>
Date
Nov 2, 2005, 09:26 UTC
Message-ID
<7v8xw7v1r0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<43687EAF.4060505@op5.se>
Andreas Ericsson <ae@op5.se> writes:
> Incidentally though, is there any way to make a commit completely go 
> away without resetting the files?

I am not sure if this is what you are looking for, but after I make a commit and find a mistake (either in the checked-in files or commit log message), I do this:

	$ git reset --soft HEAD^
        ... fix the checked-in files, maybe do git-add files that
        ... I forgot to add when I made the last commit.
        $ git commit -a -c ORIG_HEAD ;# edit commit log, too.

Soft reset leaves the working tree files intact and just rewinds the .git/HEAD to whatever commit you specify, and as a side effect stores the original .git/HEAD in .git/ORIG_HEAD. The lowercase -c flag to git-commit is "bring the commit log editor, initialized with the commit log message from that commit".

Previous: Andreas Ericsson
Message 4 of 4 in “Re: Pushing a single tag (ref + object)?”
  1. Horst von BrandOct 19, 2005
  2. Horst von BrandNov 1, 2005
  3. Andreas EricssonNov 2, 2005
  4. Junio C HamanoNov 2, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.