Skip to content

Latest commit

 

History

History
35 lines (33 loc) · 1.34 KB

File metadata and controls

35 lines (33 loc) · 1.34 KB
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
a-good-explanation-of-git-rebase
git
public
2023-02-02 08:56:12 -0800
2023-02-02 08:56:12 -0800
false
20230202165612
attachments/a-good-explanation-of-git-rebase.html
false
false
commit
git
rebase
reddit
A Good Explanation of git rebase
tech-note

A good explanation of git rebase from a thread on r/git.

The key to understanding rebase is to understand that the way everyone describes it is totally stupid. They describe it as "it replays commits from one branch to another". The problem is that describes how it does what it does. Not the what it does.

What it does is changes the commit your branch is based off of. If you create your branch off of commit 1 of main and do some dev on your branch. Then in the meantime main gets 5 more commits you can tell your branch "forgot all about the fact you were created from commit 1, let's just pretend I created you from commit 6".

Once I understood that the way it is described is stupid it made much more sense. (I still use merge instead of rebase though).

— u/wildjokers