Skip to content

Rebase

rebase

source https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase

quote from https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase

Rebasing is the process of moving or combining a sequence of commits to a new base commit.

quote from https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase

From a content perspective, rebasing is changing the base of your branch from one commit to another making it appear as if you'd created your branch from a different commit. Internally, Git accomplishes this by creating new commits and applying them to the specified base. It's very important to understand that even though the branch looks the same, it's composed of entirely new commits.

quote from https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase

You want to get the latest updates to the main branch in your feature branch, but you want to keep your branch's history clean so it appears as if you've been working off the latest main branch.

Tip

$ git fetch –all
$ git rebase origin/master