Git development
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: "Bisani, Alok" <alok.bisani@credit-suisse.com>
Cc: git@vger.kernel.org
Subject: Re: git rebase -i onto HEAD~n
Date: Tue, 3 Feb 2009 16:44:57 +0100	[thread overview]
Message-ID: <20090203154457.GA6859@atjola.homenet> (raw)
In-Reply-To: <C5E2CAEE4A87D24DAB5334F62A72D1F43ADC9D@ELON17P32001A.csfb.cs-group.com>

On 2009.02.03 15:32:35 -0000, Bisani, Alok wrote:
> Hi,
> 
> Is it possible to use git rebase -i for the following use case, in a
> local branch?
> 
> $ git reset --soft HEAD~3
> $ # magically squash HEAD~2 & HEAD, ignoring HEAD~1 (which should be
> discarded)
> $ git commit -m "new commit replacing current HEAD~2 HEAD, without the
> commit HEAD~1 (to be discarded)"
> 
> I get the error below.
> 
>     grep: /home/user/project/.git/rebase-merge/done: No such file or
> directory
>     Cannot 'squash' without a previous commit

It would be helpful if you told us what command you used, and what you
changed in the editor.

This should do:
git rebase -i HEAD~3

And in the editor:
pick HEAD~2
squash HEAD

Björn

  reply	other threads:[~2009-02-03 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 15:32 git rebase -i onto HEAD~n Bisani, Alok
2009-02-03 15:44 ` Björn Steinbrink [this message]
2009-02-03 16:22   ` Bisani, Alok
2009-02-03 17:04     ` Björn Steinbrink
2009-02-03 18:00       ` Bisani, Alok
2009-02-03 17:18     ` Sitaram Chamarty

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=20090203154457.GA6859@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=alok.bisani@credit-suisse.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