git 如何在 Github 上批准提交

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7413613/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:00:05  来源:igfitidea点击:

How To Approve Commits On Github

gitgithub

提问by Fenton

I have a project on Github and I want to create two distinct teams of contributors.

我在 Github 上有一个项目,我想创建两个不同的贡献者团队。

The first team will be a push/pull self-organising team of people who can make changes at will.

第一个团队将是一个由可以随意进行更改的人员组成的推/拉自组织团队。

The second team will be people who are new to the project and need more guidance.

第二个团队将是项目的新手,需要更多指导。

I would like to be able to "approve" the changes made by the second team - i.e. peer review them and help them to better understand our standards and the direction of the project.

我希望能够“批准”第二个团队所做的更改——即同行评审它们并帮助他们更好地理解我们的标准和项目的方向。

How do I set the permissions so they can make changes, but those changes need to be approved?

如何设置权限以便他们可以进行更改,但这些更改需要获得批准?

采纳答案by zoul

You can add the “trusted” developers as collaborators (Repository Administration → Collaborators); that gives them full read/write access. The rest of the developers can fork the repository and issue a pull request when they want to merge something back. You'll do a code review in the pull request and if it's fine, merge it.

您可以将“受信任的”开发人员添加为协作者(存储库管理 → 协作者);这给了他们完全的读/写访问权限。其余的开发人员可以分叉存储库并在他们想要合并某些内容时发出拉取请求。您将在拉取请求中进行代码,如果没有问题,则合并它。

回答by Pooja

with the latest feature launched by github, now it can be done out of the box for any member in team (better to have for all rather than excluding some).

使用 github 推出的最新功能,现在可以为团队中的任何成员开箱即用(最好是所有人都拥有而不是排除某些人)。

Steps:

脚步:

  1. ConfigureProtected Branches
  2. Disable Merge Buttonuntil commit changes are approved by a peer
  1. 配置受保护的分支
  2. 禁用合并按钮,直到对等方批准提交更改

More Details Here ...enter image description hereEdited the answer as the 1 big issue with forked repo is fixed now

更多细节在这里......在此处输入图片说明编辑了答案,因为分叉回购的1个大问题现已修复

回答by unNamed

The team which needs to be approved can pack their changes in patches and send them to a patch-queue (extra repo or special mail). The main developer team can then approve the code and apply the patch if it qualifies for it.

需要批准的团队可以将他们的更改打包到补丁中并将它们发送到补丁队列(额外的 repo 或特殊邮件)。然后,主要开发团队可以批准代码并在符合条件的情况下应用补丁。