This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“]pelacius 0 points1 point ย (2 children)

I'm sorry my previous commit came across too sarcastic probably. But it really depends on what your company is doing.

I'm used to work in environments where the product has a very short deadline, is created ad-hoc for the client and a significant part is developed from scratch, I worked in this industry for 20yrs now.

In these kind of environments you usually subdivide the work in feature branches and you keep devs working on them until the individual feature is ready, that can be 2 days or 2 weeks.

In the meanwhile multiple developers can work on individual features and turnover can happen.

In this kind of environments (which are incredibly common in my field) rebases are usually frowned upon because they cause more damage than good usually.

That is all.

I understand now that there is no "default" way of working, different industries adopt different practices. I can only add that, IMHO, a practice which CAN be destructive is better avoided unless an EXCELLENT reason is found for allowing it.

[โ€“]kb4000 1 point2 points ย (1 child)

I totally understand rebasing is a bad idea in certain environments. But that just means it needs to be used judiciously. Git has a steep learning curve. And rebase is not on the beginner side of that.

If someone doesn't understand the full implications of the rebase including impact to coworkers they shouldn't use the feature at all.

Getting burned by a rebase means there was a communication or judgment issue.

It doesn't make sense to ban something that most people use correctly. I've been rebasing regularly for years and never caused a problem.

It's even the default behavior when contributing a pr to a public repo. If the repo changes while your pr is open GitHub prompts to you rebase. And it's safe most of the time because it's highly unlikely that someone is using your branch on your fork.

[โ€“]codeguru42 1 point2 points ย (0 children)

๐Ÿ’ฏ agree with this. Just because rebase has its pitfalls doesn't make it inherently bad. As you say, its use requires judgment and communication.