When not to use "git rebase" when working with GIT branches?

I recently studied Git and learned that it rebasing

is good in some cases to avoid commits and keep history clean.

Also I read that git rebase

extra care should be taken when using .

Can someone please describe some cases in the answers below , in cases where usage git rebase

is a bad choice.

+3


source to share


1 answer


Case 1: We shouldn't be doing Rebase on a branch that is public. those. unless you are alone working on this branch and the branch exists locally and remote rebasinng is not a good choice in such branches and it can lead to bubble breaks.



Case 2: We shouldn't do Rebase on pushed commits. those. if you are working on a branch br1

and you have already dragged some commits into that branch on remote (or origin), you should not rebase on that branch br1

. Check out this question for reference: Rebasing and what does it mean to reduce by dragging committed commits

+2


source







All Articles