本文翻译自:Why is a git 'pull request' not called a 'push request'?

The terminology used to merge a branch with an official repository is a 'pull request'. 用于将分支与正式存储库合并的术语是“拉请求”。 This is confusing, as it appears that I am requesting to push my changes to the official repository. 这很令人困惑,因为我似乎要求将所做的更改推送到官方存储库。

Why is it called a pull request and not a push request? 为什么将其称为拉取请求而不是推入请求?


#1楼

参考:https://stackoom.com/question/1Ss5O/为什么git的-pull-request-不称为-push-request


#2楼

When you send a pull request, you're asking (requesting) the official repo owner to pull some changes from your own repo. 发送拉取请求时,您要(请求)正式的回购所有者从您的回购中拉取一些更改。 Hence "pull request". 因此“拉请求”。


#3楼

If you have a code change in your repository, and want to move it to a target repository, then: 如果您的存储库中有代码更改,并且想要将其移动到目标存储库,则:

  • "Push" is you forcing the changes being present in the target repository ( git push ). “ Push”是您强制目标存储库中存在更改( git push )。
  • "Pull" is the target repository grabbing your changes to be present there ( git pull from the other repo). “ Pull”是目标存储库,其中包含您要在此处进行的更改(从另一个存储库进行git pull )。

A "pull request" is you requesting the target repository to please grab your changes. “拉取请求”是您请求目标存储库,请获取您的更改。

A "push request" would be the target repository requesting you to push your changes. “推送请求”将是请求您推送更改的目标存储库。


#4楼

It's the word "Request" that is key in these actions. 这些操作中的关键是“请求”一词。 You could also think of it as saying "I have a request for you to take my work, do you accept?" 您也可以这样说:“我有要求您接受我的工作,您接受吗?” - "A Pull Request". -“请求请求”。

It's slightly confusing at first, but makes sense eventually. 起初有点令人困惑,但最终还是有道理的。


#5楼

tl;dr since I am not allowed to make a push, I'll just nicely make a request to the repo owner so they decide to pull tl; dr,因为不允许我进行推送,所以我会很好地向回购所有者发出请求,以便他们决定撤回


Who can push code to a repository? 谁可以将代码推送到存储库?

Should anyone (possibly evil or uneducated or unknown) be able to come and say here I just pushed this to your master branch and messed up all your code HAHAHA! 如果有人(可能是邪恶的,未受过教育的或未知的)可以来这里说我只是将其推送到您的master分支,并弄乱了您所有的代码,哈哈! ?

Surely you don't want him to do that. 当然,您不希望他这样做。 By default a safety net is set so no one can push to your repo. 默认情况下,设置了安全网,因此没有人可以推送到您的仓库。 You can set others as a collaborator , then they can push. 可以 将其他人设置为协作者 ,然后他们可以进行推送。 You would give such access to people you trust. 您可以将这种访问权限授予您信任的人。

So if you're not a collaborator and try to push, you will get some error indicating you don't have permission. 因此,如果您不是协作者并尝试进行推送,则会收到一些错误消息,表明您没有权限。


So how can other developers push to a repo they are not given permission to push? 那么其他开发者如何才能推送到他们没有被允许推送的仓库呢?
You can't give access to everyone, yet you want to give others an outlet/entry point so they can make 'a request to the repo owner to pull this code into the repo'. 你不能给任何人访问,但你想给别人一个出口/入口点,使他们能够做出“以回购业主的要求来这个代码进入回购”。 Simply put by making the repo accessible, they can fork it...make their changes in their own fork. 简单地说,通过使存储库易于访问,他们就可以对其进行分叉...在自己的分叉中进行更改。 Push their changes to their own fork . 自己的更改自己的叉子上 。 Once it's in their in their own remote repo: 一旦进入他们自己的远程仓库中:

They make a pull request from their fork and the owner of the upstream repo (which you can't push directly to) will decide whether or not to merge the pull request. 他们从自己的叉子发出拉取请求 ,上游仓库的所有者(您不能直接将其推入)将决定是否合并拉取请求。


Also a semi-related question I recommend reading What exactly happens in a git push? 我也建议阅读一个半相关的问题,git push到底会发生什么? Why isn't a git push considered just like a git merge? 为什么不像git merge一样考虑git push?


#6楼

拉取要求:我要求拉取我的。

为什么git的“ pull request”不称为“ push request”?相关推荐

  1. Git中pull,commit和push的概念

    简而言之: pull:将代码托管平台上的代码下载到本地代码仓库 push:将本地代码仓库的代码上传到代码托管平台 commit:将我们编辑或正在编辑的代码提交到我们的本地代码仓库 参考文章:Git中p ...

  2. 【Git版本控制】为什么要先commit,然后pull,最后再push?而不是commit然后直接push?...

    情况是这样的,现在远程有一个仓库,分支就一个,是master.然后我本地的仓库是从远程的master上clone下来的.大家都是clone下来,再在自己本地改好,再commit然后pull然后push ...

  3. git的pull和push操作

    1. git的四个区域 git本地有三个工作区域:工作区(Working).暂存区(Stage/index).资源库(Repository)和远程的git仓库(Remote) Workspace: 工 ...

  4. Git 一次性 pull push 所有的分支

    Git 一次性 pull push 所有的分支 /*************************************************************************** ...

  5. Git推送错误: failed to push some refs to ‘git@gitee.com:XXXXXX’

    项目推送时遇Git推送错误: error: failed to push some refs to 'git@gitee.com:name/project.git' 1.分析: 这个问题的产生是因为远 ...

  6. Git上传代码报错Push rejected: Push to origin/master was rejected

    Git上传代码报错Push rejected: Push to origin/master was rejected 是因为你当前的项目中有和和历史不符的东西, 所以才被拒绝了 解决方案 git pu ...

  7. push时git报错 error: failed to push some refs to 'git@gitee.com:git_zn/jianli.git' 解决办法...

    完整的错误提示如下 To gitee.com:git_zn/jl.git! [rejected] master -> master (fetch first) error: failed to ...

  8. Git上传错误解决方案:Push rejected: Push to origin/master was rejected

    问题描述: 新建一个项目在IDEA中通过Git上传码云出现Push错误:Push rejected: Push to origin/master was rejected 试了网上的方法还是不行,出现 ...

  9. eclipse git 取远程代码_【JAVA】Eclipse中使用git进行pull远程代码

    当使用eclipse或者MyEclipse进行pull远程代码的时候,或者github的代码的时候报如下错误代码: 代表我们没有配置我们的Git地址,这里我教大家配置一下.首先下面是错误代码: The ...

最新文章

  1. 【AJAX】反向Ajax第1部分:Comet介绍
  2. 程序员面试不完全指南
  3. Reverse-engineer Source Code into UML Diagrams
  4. spring学习笔记06-spring整合junit(出现的问题,解决的思路)
  5. 韩国Hana银行将建立试点验证CBDC技术
  6. [技术博客]使用wx.downloadfile将图片下载到本地临时存储
  7. vagrant 错误记录
  8. 如何完全彻底的卸载Oracle
  9. 简单OCX控件的开发
  10. Win10 虚拟桌面
  11. 2021东阳高考成绩查询,2021金华市地区高考成绩排名查询,金华市高考各高中成绩喜报榜单...
  12. 中山纪中集训Day7+8.7模拟赛题解
  13. 0x00000116错误代码 nvlddmkm.sys 蓝屏
  14. 洛谷 P1049 装箱问题
  15. Theme Studio(主题工作室)
  16. Ruby+Appium demo
  17. 基于PHP+小程序(MINA框架)+Mysql数据库的评选投票小程序系统设计与实现
  18. 网络对抗 Exp3 免杀原理与实践 20154311 王卓然
  19. ThinkPad开机停留在boot menu界面、进不了系统的解决方法
  20. 有了这些平面设计网站,可以为你提供免费素材和灵感

热门文章

  1. 恒拓开源携开源中国有望于 10 月底挂牌新三板
  2. Oracle 取某100天的每一天的日期
  3. 打印 SpringMVC中所有的接口URL
  4. IT部门如何应对VDI问题
  5. sqlserver DBLINK
  6. F5实现2台机器的热备 Priority Group Activation
  7. IDEA常用设置及推荐插件
  8. 机器学习之使用Python完成逻辑回归
  9. ubuntu系列-很好用的截图工具shutter
  10. C# -- 冒泡排序