GitHub回购,Fork或创建新分支的最佳实践 [英] Best practices on GitHub repos, to Fork or create a New Branch

查看:226
本文介绍了GitHub回购,Fork或创建新分支的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找最佳做法,在GitHub上分叉vs分支。我已阅读过此分叉与GitHub中的分支,但它不相关。

我们的5人团队正在研究同一个存储库,并且我们希望避免合并代码中的问题,冲突或回归。目标是让5个人在项目的不同部分工作,通常在同一个文件上工作。



我想知道它是否值得:


  • fork项目,工作和创建拉取请求,因此每个人都可以轻松查看代码,或者
  • 创建一个新分支 - 工作完成后在主服务器上工作并合并。


解决方案

对我来说,处理一个项目与多个开发人员的最佳实践,是使用分支模型 gitflow

首先,主分支现在仅用于跟踪您的应用,主要版本,次要版本或补丁版本的发布,并遵循 Semantic Versionning



开发分支将成为您项目的核心,因为它将使不同的功能和你的版本。



这个系统有助于减少合并数量,就像一个简单的分支系统一样,但增加了语义逻辑,简单的命令。



有关gitflow的更多信息,您可以按照此链接


I'm looking for the best practice, forking vs branching on GitHub. I've read this Forking vs. Branching in GitHub, but it's not relevant.

Our team of 5 people are working on the same repository, and we would like to avoid merging problems, conflicts or regression in the code. The goal is for the 5 persons to work on different parts of the project, often on the same file.

I would like to know if it's worth it to :

  • fork the project, work and create pull requests, so each persons can review the code easily, or
  • create a new branch - work and merge on master when work is done.

解决方案

To me, the best practice when dealing with a project with more than one developer, is to use gitflow branching model.

First, the master branch will now only be used to keep track of the releases of your app, major, minor or patch versions, following the Semantic Versionning.

The develop branch will be the core of your project, since it will make the bridge between the different features and your releases.

This system helps to reduce the number of merge, just as a simple branching system will do, but add the semantic logic, and the friendly and simple commands that comes with it.

For more info about gitflow you can follow this link.

这篇关于GitHub回购,Fork或创建新分支的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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