如何通过查看github的网络图来选择正确的分支/分支? [英] How to choose the right branch/fork to use by looking on the github's network graph?

查看:1174
本文介绍了如何通过查看github的网络图来选择正确的分支/分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用在github上公开发布的第三方代码。我正在查看该代码的github网络图,我可以看到其他叉具有一些未合并到原始存储库中的提交。



如何决定哪些分支/叉子适合我?



请在面对这样的问题时争取您的考虑。



当John Feminella建议 时,应该始终使用(通常是稳定的)发布版本的项目'。



我当然同意这个观点,但这个问题在下列情况中仍然是相关的:


  • 原始作者不再维护该代码。
  • 我需要的一项功能未在原始实现中实现,但实现方式不同在多个分支中

  • 代码仍处于开发阶段,每个分支与原始代码都有一些差异(无论是在特性中还是在开发中) isions and implementation)



我多次遇到过这种情况,目前原始作者仍然试图维持回购,但它似乎他没有足够的时间,其他叉子更积极。没有任何叉子被宣布足够稳定用于生产。上次我遇到这种情况时,原始存储库也没有实现对我很重要的功能。



因此,在这种情况下,我需要选择最稳定fork,请尝试在我的代码中使用它,彻底地测试它,并且可能会作出一些改进以使其稳定。

更新: OP澄清了他的原始问题,表明该项目已经死亡。



鉴于一个项目已经死亡,并且它有N叉子,选择最佳分叉的通常策略取决于多种因素:有的人宣布他们的最佳分叉重新接管项目的维护?在邮件列表,公共论坛等搜索新闻(不只是在GitHub上)。如果是这样,请开始关注该分支。

  • 在网络图上是否有分叉提交来自另一个分支(而不是)?如果是这样,那表明支持正在围绕这个其他分支合并,作为可能的替代项目。

  • 如果其中任何一个都行不通,更多挖掘:前一段时间是否有项目的变体,现在正在组织哪些支持?如果是这样,也许这个其他项目将满足您的需求。 b
    $ b

    没有这些,有时候项目没有支持继续前进。如果是这样的话,也许是时候搔痒自己的痒!

    原始答案



    关于此的一些评论:


    • 一般来说,您应该使用发布版本,而不是选择特定的分支或分支。如果你不这样做,那么每次项目更新时都会改变你的依赖关系,这会导致在你自己的代码中发现很难找到的错误。


    • 如果您决定始终需要最新版本,并且您可以承担风险,那么请使用该项目的 master 分支,因为这是正式版本。当你访问版本库的主页时,这将是你正在查看的默认分支。

    • 人们通常会分发存储库来制作和请求某种类型的反馈对原始代码库进行修改。 因此,除非您在修改上进行协作,否则除非您特别有兴趣尽早访问该特定代码


    关于罕见的修改,您不必担心其他分支。在某些情况下,项目的官方主线开发分支将被称为除 master 之外的其他东西。在这种情况下,您应该查阅README以查看您应该查看哪个分支。


    I need to use 3rd-party code that's available publicly on github. I'm looking at the github's network graph of that code and I can see that other forks have some commits that aren't merged into the original repository.

    How should decide which of the branches/forks is right for me?

    Please enlist your considerations while facing a problem like this.

    As suggested by John Feminella, one should always use the (usually stable) 'released versions of a project'.

    I agree with that of course, but this question is still relevant in one of the following cases:

    • The original author no more maintain that code.
    • There is a feature I need that isn't implemented in the original but implemented differently in more than one fork
    • The code is still under development stages, each fork has some differences from the original (either in features, or development decisions and implementation)

    I've faced such a case many times, currently the original author still tries to keep the repo maintained but it seems that he doesn't have enough time, other forks are more active. None of the forks is announced as stable enough for production use. Last time I faced such a case the original repository also didn't implemented a feature that was important for me.

    So in such cases I would need to choose the most stable fork, try using it within my code, test it thoroughly and possibly contribute some improvements in order to make it stable.

    解决方案

    Update: The OP clarified his original question to indicate that the project in question is dead.

    Given that a project is dead and that it has N forks, the usual strategy for picking the "best fork" depends on a number of factors:

    • Has anyone announced that they're taking over maintenance of the project? Search for news on the mailing lists, public forums, et cetera (not just on GitHub). If so, start following that fork.

    • Are there forks on the network graph that have commits coming from another fork (rather than, say, master)? If so, that indicates support is coalescing around this other fork as a possible replacement for the dead project.

    • If either of these don't work, do some more digging: Are there variants of the project that split off some time ago and around which support is now organizing? If so, maybe that other project will suit your needs.

    Failing all that, sometimes projects just don't have the support to keep going. If so, perhaps it's time to scratch your own itch!


    Original answer:

    A few comments on this:

    • In general, you should use released versions of a project, rather than choosing a particular fork or branch. If you don't, your dependencies will change every time the project updates with a new commit, which could lead to difficult-to-find bugs in your own code.

    • If you decide you always want the latest version and you're okay with the risks of that, then use the project's master branch, because that's the official one. That'll be the default branch you're looking at when you visit the repository's main page.

    • People usually fork repositories to make and solicit feedback on some kind of modification to the original codebase.

    • So, unless you're collaborating on that modification, or unless you have a particular interest in getting early access to that specific modification, you don't need to worry about the other forks.

    On rare occasions, a project's official mainline development branch will be called something other than master. In that case you should consult the README to see which branch you should look at.

    这篇关于如何通过查看github的网络图来选择正确的分支/分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆