pull request 和 merge request 的区别

本文解释了GitLab和GitHub中PullRequest(PR)与MergeRequest(MR)的名称差异,分别对应拉取和合并操作。在GitHub上,PR用于请求合并,而在GitLab中,MR强调合并过程。文章还阐述了这两种操作在开源社区与团队内部项目的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

gitlab的文档里说,Pull Request是github的叫法,因为(主仓库)第一件事要pull feature分支。同样的功能在gitlab里叫Merge Request,因为feature分支最终要被合入(目标分支)。

Merge or pull requests are created in a Git management application. They ask an assigned person to merge two branches. Tools such as GitHub and Bitbucket choose the name “pull request”, because the first manual action is to pull the feature branch. Tools such as GitLab and others choose the name “merge request”, because the final action is to merge the feature branch. This article refers to them as merge requests.

这篇文章里说,用户发起PR是为了(让主仓库管理员)执行git pull(从别人fork的仓库fetch并merge,这是连个仓库的事)。发起MR是为了执行git merge(这是一个一个仓库的事)

请添加图片描述

Remember that, in both cases, there’s a difference between the request and the command. For example, users initiate a pull request because they want to execute a Git pull command, and users submit a merge request when they want to run Git merge.

总结一下,我个人的理解:

github是开源社区,大多是项目是公共仓库,非核心成员开发完新功能是push到他们fork的仓库,因此发起PR,让核心成员先pull再merge。

而gitlab项目更多时候是团队私有的,开发人员开发完代码push到远程,这个远程本来就是主仓库了,所以发起MR,让有权限的人review完了merge。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值