From: Joshua Juran Date: Tue, 29 Mar 2011 12:44:11 GMT Subject: Re: how to squash two commits into only one Message-ID: <5A9D499C-26AC-401E-B21A-1F8E03FBAC4B@gmail.com> In-Reply-To: On Mar 29, 2011, at 3:58 AM, Alex Riesen wrote: > On Tue, Mar 29, 2011 at 12:10, Lynn Lin > wrote: >> On Tue, Mar 29, 2011 at 5:38 PM, Alex Riesen >> wrote: >>> On Tue, Mar 29, 2011 at 07:42, Lynn Lin >>> wrote: >>>> All, >>>> I have only have two commits in repo,then I want to squash these >>>> two commit into one through git rebase -i .However it fails >>>> >>>> $ git rebase -i HEAD^1 >>>> it only show up one commit so can't squash (can't squash without a >>>> previous commit) >>> >>> $ git rebase -i HEAD~2 >>> >> only have two commits > > Uh. That's unusual. > > Than yes, "git reset HEAD^; git commit --amend" seems the best > solution. Actually, that should be: `git reset --soft HEAD^; git commit --amend`. Josh