git rebase: catch up with main on your branch

calendar_today timer Reading time ~1 minute

If you work on a project with other people, there is a good chance that main keeps moving while you work on your branch. One way to catch up with those changes is using git rebase. 🤔

Hop onto your branch and then run git rebase main. That replays your commits on top of the latest main.

It is almost like you started your branch today, with everybody else’s work already in it.

And if there is a conflict, rebase will automatically pause for you to fix it and then continue.

If you are working on a project with a lot of contributions all the time, staying current is way easier than trying to fit everything in with a merge later.

Want the full breakdown? I wrote about this here: Updating a branch with git rebase

Follow for more git tips like this!

animated jess' signature

Related Articles