git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Recovering from commit --amend in rebase --interactive
@ 2010-06-01  9:27 Peter Krefting
  2010-06-01  9:48 ` Boaz Harrosh
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peter Krefting @ 2010-06-01  9:27 UTC (permalink / raw)
  To: Git Mailing List

Hi!

I am a frequent user of rebase --interactive, and sometimes I do change a 
commit to "edit", which presents me with an already committed change, which 
I can fix up, and do "git commit --amend" on.

However, sometimes I get conflicts during rebase. In some cases I have 
already seen that conflict, so rerere handles it for me. I am still dropped 
out of rebase to manually add the fixes, though.

The problem now is that is way too easy to just do a "git commit --amend" 
like in the case above, and thus overwriting the previous commit 
unintentionally.

Is there an easy way of working around the issue?


Last time this happened to me, I *did* notice my mistake as I entered the 
editor, since it came up with the previous commit's message. However, as the 
commit message file was in a good shape, I found no way to break out of the 
amend. I ended up using "git reflog" to find out what I overwrote, then "git 
diff $commitid > savedpatch" to remember what the change that I mistakenly 
amended was, then "git checkout $commitid" and "git apply savedpatch" and 
"git add" on the changed files. What I am wondering if there is an easier 
way of recovering?

-- 
\\// Peter - http://www.softwolves.pp.se/

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

end of thread, other threads:[~2010-06-03  5:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01  9:27 Recovering from commit --amend in rebase --interactive Peter Krefting
2010-06-01  9:48 ` Boaz Harrosh
2010-06-01 10:40   ` Peter Krefting
2010-06-01  9:57 ` Jan Krüger
2010-06-01 15:25   ` Ævar Arnfjörð Bjarmason
2010-06-02 23:37     ` Junio C Hamano
2010-06-03  5:54       ` Ævar Arnfjörð Bjarmason
2010-06-01 15:07 ` Gabriel Filion

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