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".