The one thing that I still have not grasped in Git, is to when to rebase. I know this article is about interactive rebasing, but when would you typically rebase? Would it be to just remove a bad commit from the tree? Thanks
There are a couple of scenarios where I would do rebasing:
When my new change is related to an older commit, could just simply be adding a comment to a function. I prefer a rebase over a new commit as it would keep my history clean and easy to understand when looking back in the future.
When pulling change from other branches, such as develop. Usually, depending on the team I'm working with. Some teams do like a clean history thus rebasing is their preference when it comes to pulling change from the main branch.
Removing bad commits is, of course, one of the usages! There are countless times where I hack something together and commit it as a "working progress" so that I wonβt lose it. Rebasing is my lifesaver to clean up my commits later.
Hope this helps π
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The one thing that I still have not grasped in Git, is to when to rebase. I know this article is about interactive rebasing, but when would you typically rebase? Would it be to just remove a bad commit from the tree? Thanks
There are a couple of scenarios where I would do rebasing:
When my new change is related to an older commit, could just simply be adding a comment to a function. I prefer a rebase over a new commit as it would keep my history clean and easy to understand when looking back in the future.
When pulling change from other branches, such as develop. Usually, depending on the team I'm working with. Some teams do like a clean history thus rebasing is their preference when it comes to pulling change from the main branch.
Removing bad commits is, of course, one of the usages! There are countless times where I hack something together and commit it as a "working progress" so that I wonβt lose it. Rebasing is my lifesaver to clean up my commits later.
Hope this helps π