Git: How to rebase to a specific commit?

You can avoid using the –onto parameter by making a temp branch on the commit you like and then use rebase in its simple form:

git branch temp master^
git checkout topic
git rebase temp
git branch -d temp

Leave a Comment