Git Rebase using Tortoise GIT
Wy should you rebase your code before commit?
https://www.atlassian.com/git/tutorials/merging-vs-rebasing Check this article!
I am using Tortoise GIT for my exercise. Here is sample of 'Logs' for code base that does not do rebase.
Change history messed up making it hard to get clarity on branch history. On close inspection, one would most likely observe same commit is appearing more than once in history due to strategy of 'merge from master' and proceed.
Here is sample 'Logs' from code base that mandates rebase by developers.
How to Rebase?
First step of course is to identify if feature branch requires rebase. Feature branch should start from the tip of master. I usually see SHA signature to find this out.
This is how I rebase using Tortoise GIT. In case if you are nervous, create copy of branch :)
Get Your 'main' branch up-to-date
Time to Rewrite History of Feature Branch
Make sure settings are right. Check high lighted sections below.
Click on start rebase, and there might be conflicts. You can 'Pick' or 'Skip' specific change.
If everything goes fine, 'Done' screen should come.
Now time to 'Push' changes to remote.
That is all :)