Does this not do what you want?
git rebase -i master..HEAD
https://www.man7.org/linux/man-pages/man7/gitrevisions.7.htm...