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

Re: Silly revert question workflow...

From
Mike Hommey <mh@glandium.org>
Date
Mar 6, 2008, 06:37 UTC
Message-ID
<20080306063731.GA8537@glandium.org>
In-Reply-To
<47CF8F4E.5010809@advancedsl.com.ar>
On Thu, Mar 06, 2008 at 03:29:34AM -0300, Gonzalo Garramuño wrote:
Show 14 quoted lines
>
> I'm wondering if there's any easy way to basically "fix" the last commit  
> from the history.  To explain a little bit...
>
> Being the silly guy I am, one of the very common things I do is that I  
> may be working on two features simultaneously.
> Then one feature is done, I will do a check-in and then seconds later  
> I'll realize that I forgot to add, say, another .h file that was also  
> modified and that I thought was not needed for that commit.
> Sure enough, without that .h file the tree as checked in is really in an  
> uncompilable state.
>
> git revert allows me to revert the commit and do it again.  But it still  
> leaves a commit in the history tree that is uncompilable.
You are looking for git commit --amend
Mike
Previous: Gonzalo Garramuño
Message 2 of 2 in “Silly revert question workflow...”
  1. Gonzalo GarramuñoMar 6, 2008
  2. Mike HommeyMar 6, 2008

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.