$ git --version
git version 2.11.0 (Apple Git-81)
$ git log --oneline | cat
f494716 Commit to merge
297dd99 Commit not to merge
d3bd657 Initial commit
$ git rebase --onto master dev
First, rewinding head to replay your work on top of it...
Applying: Commit to merge
$ git log --oneline | cat
ef49494 Commit to merge
4c3a806 Commit on master
d3bd657 Initial commit
Based on : https://stackoverflow.com/questions/10853935/change-branch-base
Tested on
git version 2.11.0 (Apple Git-81)
: