Git development
 help / color / mirror / Atom feed
From: Brent Goodrick <bgoodr@gmail.com>
To: git@vger.kernel.org
Subject: How do I undo a fast-forward merge safely?
Date: Sun, 22 Feb 2009 11:15:51 -0800	[thread overview]
Message-ID: <e38bce640902221115o2dd1c63dv6f7acc374b48d418@mail.gmail.com> (raw)

I had done a git merge --no-commit <source_branch> operation, but that
bit me because I mistakingly concluded that --no-commit would prevent
any type of automatic operation, but apparently a fast-forward
occurred.  I should have used the --no-ff option? How do I get my
target branch back to where it was before the bad merge?

I did make a backup of the entire repo before I started, so I do have
the plan-B option of replay my changes onto a copy of the backup repo.
  But, maintaining backup copies just so as to avoid getting bit each
time I forget to use the --no-ff option will be a non-starter, so I
would hope there are some safe commands I can use to go back to the
original.

git log -1 does not show the commit, but gitk does show a vertical red
line that I can only presume indicates the fast-forward.  How does
gitk determine that red line, while git-log does not?  Note that I
have not pulled into any other repo's yet, and won't until I can
rectify this issue.

Here was my bad git merge command line:

$ git merge --no-commit source_branch
Updating 7eb9a02..0c66ca1
Fast forward
<eliding list of files I want mixed in with lots of files I don't want>

So, what operations, rebase, reset, etc, do I need to do to get this
repo back to where it was right before the fast-forward?

Thanks,
Brent

             reply	other threads:[~2009-02-22 19:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-22 19:15 Brent Goodrick [this message]
2009-02-22 19:54 ` How do I undo a fast-forward merge safely? Jakub Narebski
2009-02-24  5:37   ` Brent Goodrick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e38bce640902221115o2dd1c63dv6f7acc374b48d418@mail.gmail.com \
    --to=bgoodr@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox