git rebase --onto: move the right commits to a new base

git rebase --onto: move the right commits to a new base

git rebase --onto looks like a complicated variation of git rebase. I avoided it for a long time for that reason. Yet this option answers a very specific question: how do you move only part of a branch to a new base without bringing along the commits below it? This happens when a branch was created from the wrong branch, a branch stack needs to be reorganized, or a few useful commits are trapped in the middle of a history. A standard rebase chooses what to replay implicitly. With --onto, you explicitly define the new base, the boundary of the commits to exclude, and the branch to move. ...

September 8, 2026 · 8 min · Anthony
Why a blog about Python, Django, Architecture and best practices?

Why a blog about Python, Django, Architecture and best practices?

This blog is first and foremost a place to share: discoveries, thoughts, things that have been useful to me and might be useful to others. Python, Django, Architecture and best practices: the heart of this blog The heart of the blog is Python development, and more specifically the frameworks that shape my daily work: Django, FastAPI and Flask. Each has its strengths, its use cases, its pitfalls. We’ll dig into all of them. ...

May 4, 2026 · 2 min · Anthony

Newsletter

Get new articles delivered straight to your inbox.

No spam. Unsubscribe in one click.