关于refs/for/ 和refs/heads/
1. 这个不是git的规则,而是gerrit的规则,
2. Branches, remote-tracking branches, and tags等等都是对commite的引用(reference),引用都以 “refs/……”表示. 比如remote branch: origin/git_int(=refs/remotes/origin/git_int), local tag: v2.0(=refs/tags/v2.0), local branch: git_int(=refs/heads/git_int)…
3. 简单点说,就是refs/for/mybranch需要经过code review之后才可以提交;refs/heads/mybranch不需要code review。
(since you want to directly push into the branch, rather than create code reviews. Pushing to refs/for/* creates code reviews which must be approved and then submitted. Pushing to refs/heads/* bypasses review entirely, and just enters the commits directly into the branch. The latter does not check committer identity, making it appropriate for importing past project history)
如果需要code review,直接push
$git push origin master
那么就会有“! [remote rejected] master -> master (prohibited by Gerrit)”的错误信息
而这样push就没有问题,
$git push origin HEAD:refs/for/mybranch
下面一段是对“refs/for”更详细的描述:
The documentation for Gerrit explains that you push to the "magical refs/for/'branch' ref using any Git client tool".
This image is taken from the Intro to Gerrit. When you push to Gerrit, you do git push gerrit HEAD:refs/for/<BRANCH>. This pushes your changes to the staging area (in the diagram, "Pending Changes"). Gerrit doesn't actually have a branch called <BRANCH>; it lies to the git client.
Internally, Gerrit has it's own implementation for the Git and SSH stacks. This allows it to provide the "magical" refs/for/<BRANCH> refs.
When a push request is received to create a ref in one of these namespaces Gerrit performs its own logic to update the database, and then lies to the client about the result of the operation. A successful result causes the client to believe that Gerrit has created the ref, but in reality Gerrit hasn’t created the ref at all.
After a successful patch (i.e, the patch has been pushed to Gerrit, [putting it into the "Pending Changes" staging area], reviewed, and the review has passed), Gerrit pushes the change from the "Pending Changes" into the "Authoritative Repository", calculating which branch to push it into based on the magic it did when you pushed to refs/for/<BRANCH>. This way, successfully reviewed patches can be pulled directly from the correct branches of the Authoritative Repository.
关于refs/for/ 和refs/heads/的更多相关文章
- [Git] 关于refs/for/ 和refs/heads/
转载自: http://lishicongli.blog.163.com/blog/static/146825902013213439500/ 1. 这个不是git的规则,而是gerrit的规 ...
- react中的refs
概述 很久之前就知道refs,感觉好神秘,恰好今天突然发现字符串形式的ref在官网不推荐使用了,于是好好总结一下ref的用法,供以后开发时参考,相信对其他人也有用. 参考资料: Refs & ...
- Refs & DOM
Refs 提供了一种访问在 render 方法中创建的 DOM 节点或 React 元素的方式. 在典型的 React 数据流中, 属性(props)是父组件与子代交互的唯一方式.要修改子组件,你需要 ...
- vue & button & refs & click & bug
vue & button & refs & click & bug $refs.btn.click() ??? vue & refs $refs.btn.$em ...
- Vue处理边界之$root、$parent、$refs
Vue处理边界之parent.$refs 下面的功能都是有风险的,尽量避免使用 1.Vue 子组件可以通过 $root 属性访问父组件实例的属性和方法 <div id="app&quo ...
- Vue父子组件传值之——访问根组件$root、$parent、$children和$refs
Vue组件传值除了prop和$emit,我们还可以直接获取组件对象: 根组件: $root // 单一对象 表示当前组件树的根 Vue 实例,即new Vue({...根组件内容}).如果当前实例没有 ...
- Vue $root、$parent、$refs
Vue处理边界parent.$refs 下面的功能都是有风险的,尽量避免使用 Vue 子组件可以通过 $root 属性访问父组件实例的属性和方法 <div id="app"& ...
- Refs
一.The ref callback attribute ref:reference,父组件引用子组件 组件并不是真实的 DOM节点,而是存在于内存之中的一种数据结构,叫做虚拟DOM.只有当它插入文档 ...
- git:hook declined FATAL: W refs/heads DENIED by fallthru error
hook declined FATAL: W refs/heads DENIED by fallthru error git提交代码时报错,网上查了,最终结果竟然是测试人员没有给我配置写的权限,配置了 ...
随机推荐
- 十一个行为模式之中介者模式(Mediator Pattern)
定义: 用一个中介对象(中介者)来封装一系列的对象交互,使各个对象之间不需要显式地相互引用,从而降低耦合度,而且可以独立地改变他们之间的交互关系. 解耦后: 结构图: Mediator:抽象中介者,定 ...
- 一款简洁大气的jquery日期日历插件
本jquery插件名为manhuaDate,暂时只支持jquery 1.9.0以下版本,比如jquery-1.8.3.min.js 查看效果网址:http://keleyi.com/a/bjad/em ...
- jQuery实用小技巧--输入框文字获取和失去焦点
<input id="txt" class="text1" type="text" /> <script src=& ...
- javascript的函数
1.函数的声明 (1) function命令方式 function fn(){}; (2) 函数的表达式 采用变量赋值的方式,function命令后面不带有函数名.如果加上函数名,那么该函数名只在函数 ...
- ae 地理坐标与投影坐标转换 [转]
转载地址:http://blog.163.com/lai_xiao_hui/blog/static/123037324201151443221942/ 代码是将WGS84地理坐标转换为WGS84UTM ...
- IOS开发基础知识--碎片24
1:兼容字体大小6plue跟它以下的区别 #define FONT_COMPATIBLE_SCREEN_OFFSET(_fontSize_) [UIFont systemFontOfSize:(_fo ...
- 使用Intellij IDEA搭建Ext JsMVC web项目
由于自己从android开发转来学习web开发,最近在学习Jsp,之前接触过一点Extjs,所以用jsp来配合ext试试. Ext JS介绍 extjs是一个javascript框架,它的好处就是有它 ...
- Android编码规范04
private final String MESSAGE_WARN = "您输入的密码有误,请重新输入!"; private final String CLASS_ONE = &q ...
- 支付宝alipay使用小结 调用支付宝程序被杀死说明
一. 准备阶段 如果没有蚂蚁金服开放平台的注册账号,则需要实现注册一个,这里多说一点,就是当我们以公司名义注册账号时,需要预备公司的营业执照等物品(需要上传照片等信息审核).账号申请成功之后,我们需要 ...
- IE6、IE7兼容querySelectorAll和querySelector方法-最终版本
querySelector 和 querySelectorAll 方法是 W3C Selectors API 规范中定义的.他们的作用是根据 CSS 选择器规范,便捷定位文档中指定元素.目前几乎主流浏 ...