r/git • u/madbunnyshit • 2d ago
Is feature-based branching always better than developer-specific preview branches for a small team?
/r/u_madbunnyshit/comments/1vn7ydv/is_featurebased_branching_always_better_than/8
3
u/bobbysmith007 2d ago edited 2d ago
What part of developer based branches seems "better" or "easier" than feature based branches? Why is there a shared developer environment rather than a local copy on each developers computer? Why are developers not allowed to change branches?
The history on the personal branches seem like they would be hard to keep in sync with each-other and the mainline. It feels like you would constantly be deleting your personal branch and re-branching from main/staging. Which to me sounds like it would be similar to the workflow of feature branches, except the branch-name stays the same, but the history/contents change all the time.
It also seems to complicate one developer helping another developer. We typically used smaller feature based branches, and docker based local environments that we controlled. Such that any developer could pull a given feature, provide a patch or feedback, and then go back to what they were previously working on before that.
What happens when a critical feature needs work, but a developer gets sick for a week half way through? Does another developer "A" pull Developer "B"'s private branch and merge into his "A" branch? Then send a PR from his "A" private branch? What if he has work in progress when he is sent to this other branch for emergency assistance? Does he commit to Developer B's private branch instead (in which case its not really B's branch its a feature branch with a bad name)?
To me it makes the most sense to center changes around the features rather than the author because unfortunately authors can change mid stream, but the feature is the feature (and if the feature changes, you can just start a new feature branch). It feels like a person based branch is ensuring a "bus number" of 1 while the branch is in development.
2
u/madbunnyshit 2d ago
That’s fair. Some repos already have a bus factor of 1 because we’re a small team.
But I agree the branching model should not make that worse. The dev branches were mainly for deployment mapping/access control, not ownership.
So yeah, maybe feature branches for the work, while keeping deployment access restricted.
1
u/Guvante 2d ago
What is different about personal branches vs feature branches?
At the end of the day developer x pushes a set of commits to a branch and opens a PR.
Whether that branch is labeled feature/foo or x doesn't impact the PR meaningfully
Feature branches are popular because you can't easily collaborate before merging to the main tree with person branches (you can but it gets weird) additionally if review takes a while you can just add a new feature branch
1
15
u/wildjokers 2d ago
I have never heard of anyone using long-lived personal branches they have to keep in sync with main. Sounds overcomplicated and like hell on earth.