rebase
What is git rebasing?
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
For example:
You create the branch Feature-1 from the master branch.
Now the master branch gets updated and differs from the base the branch Feature-1 was based upon.
In order to rebase your branch (so you get the updated code that is currently on the master branch processed into your branch) you type the following command ON the Feature-1 branch
git rebase master
Now you should have your branch updated with the latest version of the master branch
Unwritten rule
Merge to the master branch and rebase the feature branches
Rebasing will also keep the log intact on your feature branch. Checkout this video between 9:20 and 10:20 to understand the concept better.
How to use git rebasing?
follow the steps in the video, which can be found in the references
References
Difference between git rebasing and git merging https://www.youtube.com/watch?v=CRlGDDprdOQ
Last updated
Was this helpful?