在功能分支上使用拉取请求而不是合并。是git流量吗?

Using pull request Instead of merge in working on feature branches. Is it git flow?

我想知道的

我想在功能分支上使用拉取请求而不是合并。是不是也git流量

为什么要启动这个想法?

  1. 我更喜欢使用 pull request 而不是 merge 来审查源代码。

  2. 不想在 master 中保留 'commit history' 我的功能分支。

请显示任何推荐的 git 存储库。例如

我想找到遵循 git 流程的存储库以研究 git 流程。

您会推荐 git 流程上的任何存储库吗?我会标记星标并关注您或其他人的存储库

Git中心 Atom repository is a good example of an open source project where contributors create a branch, commit and push to that branch, and when ready, open a pull request. If the pull request is accepted by the project's owners it is merged. Here is a link to merged pull requests.

I want to use pull request than merge in working on feature branches. Is it git flow too?

创建一个新分支,在该分支上工作,打开拉取请求以供审查并最终合并您的更改是 Git Flow 和 GitHub Flow.[=15= 的最佳实践]

I prefer to use pull request than merge for source code review.

是的,这太棒了。您可以利用 protected branches and required status checks 的强大功能来自动测试并确保在满足所有要求的条件之前无法合并分支。

希望对您有所帮助 - 如果这没有回答您的问题,请告诉我。

您可以安装 git 个扩展来支持 git-flow。 git-flow 的 AVH 版本有一些很棒的特性: https://github.com/petervanderdoes/gitflow-avh

它支持挂钩(自定义脚本): https://github.com/petervanderdoes/gitflow-avh/wiki/Reference:-Hooks-and-Filters#hooks

您可以使用 Mac 安装到 AVH 版本:

brew install git-flow-avh

要在 git 流程中支持拉取请求,您可以添加脚本:

.git/hooks/post-flow-feature-publish.sh

当运行命令时:

git flow feature my-feature publish

Git流程会将代码推送到功能分支并调用钩子脚本创建PR。