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:

  • bitbucket can't pull/push from repository
  • How can I tell if one commit is a descendant of another commit?
  • Convert an SVN repository to git with reposurgeon without creating .gitignore files?
  • How to make Git log show all of today's commits?
  • How to handle a Git discontinuity?
  • is it possible to provide alternative fixes in the same 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 works, remote push doesn't. Remote repository over copssh
  • error: RPC failed; result=6, HTTP code = 0
  • git workflow with review
  • Remote origin already exists on 'git push' to a new repository
  • Deploying application to two different servers, with different production.rb contents
  • How to disable git 'Push Results' dialog in eclipse
  • 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.