git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Silly revert question workflow...
@ 2008-03-06  6:29 Gonzalo Garramuño
  2008-03-06  6:37 ` Mike Hommey
  0 siblings, 1 reply; 2+ messages in thread
From: Gonzalo Garramuño @ 2008-03-06  6:29 UTC (permalink / raw)
  To: git


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.

This also happens to me when I am in a different branch doing fixes and 
I need to quickly go to another branch to do changes there (ie. in the 
same dir, without cloning), so I end up doing a commit in the fix branch 
of my temporary stuff and then do a co of the stable branch.
I would like to then later go back to the fixing branch and remove that 
temporary commit (or ammend it changing all its history).


-- 
Gonzalo Garramuño
ggarra@advancedsl.com.ar

AMD4400 - ASUS48N-E
GeForce7300GT
Xubuntu Gutsy

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Silly revert question workflow...
  2008-03-06  6:29 Silly revert question workflow Gonzalo Garramuño
@ 2008-03-06  6:37 ` Mike Hommey
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Hommey @ 2008-03-06  6:37 UTC (permalink / raw)
  To: Gonzalo Garramuño; +Cc: git

On Thu, Mar 06, 2008 at 03:29:34AM -0300, Gonzalo Garramuño wrote:
>
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-06  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06  6:29 Silly revert question workflow Gonzalo Garramuño
2008-03-06  6:37 ` Mike Hommey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).