From: Björn Steinbrink Date: Tue, 03 Feb 2009 15:44:57 GMT Subject: Re: git rebase -i onto HEAD~n Message-ID: <20090203154457.GA6859@atjola.homenet> In-Reply-To: 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