TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Trunk-based development vs. long-lived feature branches

22 pointsby freedudeover 1 year ago

9 comments

modelessover 1 year ago
Was this article written by ChatGPT? It's the same wishy-washy style. Ignore the article, the actual answer is always trunk-based development. Long lived feature branches will always come back to bite you.
评论 #37561303 未加载
评论 #37561613 未加载
评论 #37564434 未加载
mqusover 1 year ago
&gt; Branching strategies like Git Flow popularized this approach, and it&#x27;s extremely common in open source software, where typically community contributors do not have mainline access, and so much create branches and make pull requests<p>No? I thought Git flow had feature branches, but those were not supposed to live long, just like in every case. Long-lived feature branches should get long-lived by necessity (someone working a long time on a feature that can&#x27;t or shouldn&#x27;t be cut down), not by choice. In open source, feature branches are long-lived because either they don&#x27;t get reviewed or the contributor lost interest&#x2F;does not have the time to finish it. They didn&#x27;t choose to make those branches long-lived.<p>Maybe I just misunderstand what &quot;long-lived&quot; means in this context.
评论 #37562470 未加载
评论 #37561672 未加载
miked85over 1 year ago
<a href="https:&#x2F;&#x2F;trunkbaseddevelopment.com" rel="nofollow noreferrer">https:&#x2F;&#x2F;trunkbaseddevelopment.com</a> is probably a good resource to look at. Long lived feature branches have <i>never</i> worked well in my experience.
评论 #37561447 未加载
评论 #37561800 未加载
willsmith72over 1 year ago
The long-lived feature branch &quot;pros&quot; made me shiver. I hope I never work in an environment like that again
评论 #37561890 未加载
评论 #37561768 未加载
zabilover 1 year ago
You can enjoy the benefits of both approaches by adopting trunk-based releases. In our experience, we make small pull requests (like short lived feature branches) on GitHub, each focusing on a complete feature or a segment of it.<p>GitHub Actions automatically test these pull requests and create temporary environments for further testing. If all tests pass, the code enters the merge queue and gets released as soon as it&#x27;s merged into the main branch. We release every commit, keeping the main branch&#x27;s release log tidy. We also use a mono-repo and implement caching, ensuring that only the modified code gets packaged and released.
ulizzleover 1 year ago
Long lived means gigantic. It’s not a bad idea if you have a decent test suite. But if you don’t have one it’s too risky and can easily get out of control.
freedudeover 1 year ago
Full Title: &quot;Trunk-Based Development vs. Long-Lived Feature Branches: Which One is Right for Your Software Team?&quot;
senfiajover 1 year ago
Maybe there is a middle ground, such as creating &quot;v2&quot; (or whatsoever) folder with the newest changes where you can easily switch between the old and the new functionality.
da39a3eeover 1 year ago
TLDR<p>Trunk-based development = putting unfinished work in the team&#x27;s shared branch.<p>Feature-branches = finishing your work first.<p>Anyone who&#x27;s ever completed a complex PR knows how much plans change over the course of the work. Obviously those immature stages shouldn&#x27;t be shared with the team, let alone be in main, whether behind feature flags or not.
评论 #37561929 未加载
评论 #37566305 未加载