I've been learning Git recently and came to know rebasing
is good in some cases to avoid merge commits and keep history clean.
Also I read that extra care should be taken while using git rebase
.
Can someone please describe some cases in answers below,
in which cases using git rebase
is a bad choice.
Case 1: We should not do Rebase on branch that is public, i.e. if you are not alone working on that branch and branch exists locally as well as remotely rebasing is not a good choice on such branches and it can cause bubble commits.
Case 2: We should not do Rebase on pushed commits, i.e. If you are working on branch br1
and you already have pushed some commits to this branch on remote (or origin) you should not do rebase on this branch br1
. Check this Question for reference: Rebasing and what does one mean by rebasing pushed commits
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With