简体   繁体   English

github中的代码审查和提取请求工作流程

[英]code review and pull request workflow in github

I am confused with whole process of code review and pull request workflow in github. 我对github中的代码检查和请求请求工作流的整个过程感到困惑。

I created a branch from master called error_2726_fixes . 我从master创建了一个名为error_2726_fixes的分支。 I committed all my changes and pushed error_2726_fixes branch to github. 我提交了所有更改,并将error_2726_fixes分支推送到 github。 Now my question is how code review is done. 现在我的问题是代码审查是如何完成的。 With my research and study this is what i understand 通过我的研究和学习,这就是我的理解

  • Create new branch (say code_review ) from master branch and create pull request to merge branch error_2726_fixes to code_review branch. 创建从主分支新分支(比如code_review)并创建拉出请求分支error_2726_fixes合并code_review分支。
  • after incorporating all review merge error_2726_fixes to code_review 将所有评论合并错误 _2726_fixes合并到code_review之后
  • Finally merge code_review branch back to master 最后将code_review分支合并回master

Is this correct workflow ? 这是正确的工作流程吗? Do I have to create code_review branch. 我是否必须创建code_review分支。

Could someone please explain me this process. 有人可以给我解释一下这个过程。

This is one of those highly-opinionated parts of software engineering, where there are many different ways to do it, and each way has its pros and cons. 这是软件工程中那些带有高级定义的部分之一,在其中有许多不同的实现方法,每种方法都有其优缺点。 But for the sake of your question, let's consider what I would say the norm is from my time on GitHub: 但是出于您的问题,让我们考虑一下我所说的规范是基于我在GitHub上的时间:

  1. (Optionally) You fork the repository to your own account (可选)将存储库分叉到自己的帐户中
  2. You start work on some branch, error_2726_fixes 您开始在某个分支上工作, 错误_2726_fixes
  3. You finish work on the branch 您完成了分支机构的工作
  4. You open a pull request on this branch 您在此分支上打开请求请求
  5. Maintainers and collaborators opt in to review your changes on the PR 维护者和合作者选择查看您对PR所做的更改
  6. Eventually, the branch is merged into the base branch (typically master) via this PR 最终,该分支通过此PR合并到基础分支(通常是主分支)中

Because code review is done on the pull request and not a branch via commits like you expected, there is no need for the code_review branch in your question. 因为代码检查是在pull请求上完成的,而不是通过分支(如您期望的那样)进行,所以您的问题中不需要code_review分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM