4

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:

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?

2
  • 1
    Why would you want to merge or squash your commits while editing the commit message? Commented Oct 16, 2015 at 20:26
  • Because I'm already on ~30 commit starting from root and I don't want to start the process anew. Anyway I just want to know if I can do that. Commented Oct 16, 2015 at 20:29

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.