admin管理员组文章数量:1395752
I want to create a script that makes sure contributors in my project are rebasing their changes before merging, rather than merging first from the target branch before then merging their changes back.
I could banish all merge commits from merge request branches, but merge commits are still useful (for example, a mega-branch that has incorporated several smaller merge requests, to be merged into the main branch). Allowing merge commits also creates a situation where a contributor could merge a small branch that has a merge commit containing changes from the main branch, and so on.
If I have two branches, branch/feature
and main
, how can I walk the commit graph to be sure that it's a proper tree, all the way down to the proposed merge base?
I tried going through the commits and parsing the merge messages themselves, but those can easily be edited. I'm trying to figure out a solution that traverses the graph itself.
本文标签: How can I check if the current git branch (down to its merge base) is a proper treeStack Overflow
版权声明:本文标题:How can I check if the current git branch (down to its merge base) is a proper tree? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744087484a2588797.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论