简体   繁体   English

功能分支和拉取请求-Git

[英]Feature branches and Pull Requests - Git

Can I make users of an open source project, clone the project, branch off to a feature branch, make their changes, test by rebasing their code on top of the current working branch and then push, for a pull request, their feature branch so I can rebase their changes into my work? 我可以让一个开放源代码项目的用户,克隆该项目,分支到功能分支,进行更改,通过将代码重新建立在当前工作分支之上进行测试,然后将其功能分支推送到请求请求中,以便我可以将他们的更改重新纳入我的工作中吗? (not sure if thats how most open source communities actually work ... ) (不确定多数开源社区是如何工作的……)

So it would look like this: 所以它看起来像这样:

Project On Github
     |
Clone Project
     |
git checkout branch x.x
git checkout -b new_feature
... Add some code/fix some issues .. TDD is a must
git commit // Commit your stuff.
git checkout branch x.x
git rebase new_feature
.. Rebaseing ...
.. Test to make sure it works // unit tests :D ..
git checkout branch new_feature
     |
submit this branch, new_feature, as a pull request
     |
I see new branch, I review, I rebase or reject.

Is this a typical kind of workflow? 这是典型的工作流程吗? or how do most open source communities handle this, realizing that question is ambiguous and can result in this being closed, how would you handle this situation assuming it was your open source project? 还是大多数开放源代码社区如何处理此问题,意识到这个问题是模棱两可的,并可能导致封闭,如果假定这是您的开放源代码项目,您将如何处理这种情况? is this a "standard" way of doing it? 这是“标准”的做法吗?

To answer the first part of your question: Yes. 要回答问题的第一部分:是的。

Can they clone? 他们可以克隆吗? Yes, they can clone any public repository. 是的,他们可以克隆任何公共存储库。
Can they create branch? 他们可以创建分支吗? Yes, they can branch any cloned repository. 是的,他们可以分支任何克隆的存储库。
Can make changes? 可以改变吗? Yes, they can branch any cloned repository. 是的,他们可以分支任何克隆的存储库。
Can do tests by rebasing on top of the current working branch? 可以通过在当前工作分支的基础上重新进行测试吗? Yes, developers using git usually checkout the branches they are interested in editing before they start to work, and then generate commits on top of that, no need to rebase (yet). 是的,使用git的开发人员通常在开始工作之前签出他们感兴趣的分支,然后在此基础上生成提交,而无需重新设置(尚未)。
Can they send pull requests? 他们可以发送拉取请求吗? GitHub lets them create pull requests . GitHub允许他们创建请求请求

Then, you can either merge the pull request or reject/delete the pull request . 然后,您可以合并拉取请求拒绝/删除拉取请求

As GitHub documentation describes, Approvers (devs with write permissions on the main repository) can either merge the pull request from the web, or checkout the pull request and work on it (modify it, rebase it, whatever you like) and then push the accepted changes. 如GitHub文档所述,审批者(对主存储库具有写权限的开发人员)可以合并Web上的拉取请求,或签出拉取请求并对其进行处理(对其进行修改,变基,无论您喜欢什么),然后推送接受的更改。

To answer your second part: IMO this is a good way to receive code contributions from other professionals on the internet. 回答您的第二部分:IMO这是从互联网上接收其他专业人员的代码贡献的好方法。

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

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