How to squash (merge with next one) commit during rebase?

This is my pseudo tree:

A---B---C---D (master)

I started interactive rebase from the root: git rebase --root -i and set edit command for all commits. Here is example:

  • How to make travis-ci work with a local git branch instead of a specific commit?
  • How to ignore files ending with ~ in git?
  • Git under windows: MSYS or Cygwin?
  • Git - Save Work in Progress — Changes Missing After Branching
  • What's the bzr equivalent to git clone --depth HEAD
  • is it dangerous to create a branch with same name as a deleted branch?
  • e b83fa60 Initial content (A)
    e 9a82ddf Update license information (B)
    e fa8cb80 Rewrite readme (C)
    e 0525f07 Update email address (D)

    Now I’ve stopped at B during rebase:

    A---B---C---D (master)

    At this point I want to “merge” or “squash” B with the next C commit. How can I do it?

  • Git clone fsync input/output error in linux
  • git hook flake8: error: input not specified
  • TeamCity Trigger Build when specific c# Project is changed
  • Git Clean Filter Breaking on Empty Files
  • Git for SVN users
  • git clone requires ssh:// protocol when perhaps it shouldn't?
  • One Solution collect form web for “How to squash (merge with next one) commit during rebase?”

    git rebase --continue will stop you at the next e commit which is C, then git reset HEAD^ && git add . && git commit --amend will squash current(C) with previous (B). Although I would personally simply continue rebase and redo again with marking C as s or f – much simpler and faster.

    Git Baby is a git and github fan, let's start git clone.