I have a branch "master" which has 5 commits:
A --> B --> C --> D --> E (master)
Now I want to merge the intermediate commits B, C, and D into one because their changes are trivial. I wish the result after merging is:
A --> B' --> E (master)
I tried the command git rebase -i A D
and it results in a detached head that is not in the master branch. But I want to stay in the master branch, how can I do that?