Skip to content

TIL: Semi-Linear History

I have been doing this for a while, but I only recently learned that it’s called “semi-linear history”.

You merge a feature branch into the main branch by first rebasing it onto the main branch, and then creating a merge commit.

semi-linear merge animation
Image from Microsoft Dev Blogs

It makes perfect sense to me: you keep feature branches up to date with the main branch and create merge commits, which lets you see individual changes clearly separated from other commits.

semi-linear history animation
Screenshot from GitLab Docs

GitLab implemented “semi-linear history” back in 2016, and GitHub still doesn’t support it.