Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 14
    Doing git rebase -i HEAD~2 for me brings up an editor with like 20 lines of commits. And none of them are the last two commits I want. What's going on?
    – B T
    Commented Jun 26, 2015 at 17:57
  • 5
    Probably your previous commit is a merge. Commented Oct 29, 2015 at 13:57
  • See also @omerjerk's answer below about editing the last 2 commits from pick to squash
    – frankster
    Commented Jul 25, 2016 at 10:34
  • 7
    this isn't useful if you've merged in a branch like master that has more recent updates Commented Aug 29, 2020 at 14:24