DEV Community

Waylon Walker
Waylon Walker

Posted on • Originally published at waylonwalker.com

5 1

Git rebase to the beginning of time

Git has a built in way to rebase all the way back to the beginning of time. There is no need to scroll through the log to find the first hash, or find the total number of commits. Just use --root

git rebase --root
Enter fullscreen mode Exit fullscreen mode

Top comments (3)

Collapse
 
aerabi profile image
Mohammad-Ali A'RÂBI

Jeez! In the case of an interactive rebase, you probably have to edit the TODO file for hours. :D

Collapse
 
amye profile image
Amy Elliott

What does rebase mean? Is it a dangerous command? does it 'push' anything?

Collapse
 
aerabi profile image
Mohammad-Ali A'RÂBI

Rebase is changing history, and is usually used when you want to put your feature branch ahead of the master branch. It doesn't push anything automatically, you should do it manually afterward.

Maybe this podcast episode might be helpful.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay