How can I merge 2 commits into 1

Posted by michael on Stack Overflow See other posts from Stack Overflow or by michael
Published on 2010-04-01T20:56:53Z Indexed on 2010/04/01 21:03 UTC
Read the original article Hit count: 194

Filed under:

Hi,

I am trying to merge 2 commits into 1. So I follow this:

http://www.gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

I did $ git rebase --interactive HEAD~2 It opens an editor I change 'pick' to 'squash' Save the editor But i get 'Cannot 'squash' without a previous commit'

so what can I do to recover?

When I do ' git rebase --interactive HEAD~2 Interactive rebase already started'

When I do '$ git rebase --continue Cannot 'squash' without a previous commit'

Thank you.

© Stack Overflow or respective owner

Related posts about git