GIT:拉取请求和合并有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21247482/
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-10 17:36:24  来源:igfitidea点击:

GIT: Whats the Difference between a Pull Request and a Merge?

gitgithubbitbucketgit-mergepull-request

提问by xRavisher

On services like bitbucket and github you have the option to create a pull request..

在像 bitbucket 和 github 这样的服务上,您可以选择创建拉取请求。

My question to you (developers), is what are all of the differences between the two?

我对您(开发人员)的问题是,两者之间的所有区别是什么?

Differences I currently know of:

我目前知道的差异:

  • Ability to approve or reject request
  • Ability to provide add a descriptive message with the request
  • 能够批准或拒绝请求
  • 能够在请求中添加描述性消息

Other than that it seems like a pull request is just essentially a merge.. correct?

除此之外,似乎一个拉取请求本质上只是一个合并..对吗?

回答by First Zero

Yes that is correct, the pull requeston GitHub and Bitbucket is a request to merge two branches.

是的,这是正确的,pull request在 GitHub 和 Bitbucket 上是合并两个分支的请求。

One of the use cases is to have a QA person who is not the developer review and approve the merge request.

用例之一是让一个不是开发人员的 QA 人员和批准合并请求。

Another use case is development on masterbranch is not allowed. A developer always develop on another branch. Once the development is completed, a pull request is created to merge into masterbranch.

另一个用例是master不允许在分支上进行开发。开发人员总是在另一个分支上开发。开发完成后,会创建一个 pull request 合并到master分支中。

回答by larsks

A "pull request" is a request to an upstream repository to merge some changes into their code ("pull changes from my repository and add them to yours, please"). So it's not really like a merge at all -- it's a requestto merge.

“拉取请求”是对上游存储库的请求,以将一些更改合并到他们的代码中(“请从我的存储库中拉取更改并将它们添加到您的存储库中”)。所以它根本不像是合并——它是一个合并请求