Skip to main content

12 Git rebase

1 what is git rebase?

git rebase is a command that allows you to integrate the changes of one branch onto another. It is an alternative to the better known "git merge" command.

2 how to use git rebase?

for example: we have a branch named "feature" and we want to integrate the changes of "feature" into "master".

git rebase master # the current branch is "feature"
git checkout master # switch to master branch
git merge feature # merge feature into master