关于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提交代码时报错,网上查了,最终结果竟然是测试人员没有给我配置写的权限,配置了 ...
随机推荐
- spring入门(五)【springMVC环境搭建】
springMVC作为spring的一个WEB组件,是一个MVC的思想,减少了WEB开发的难度,现介绍springMVC环境的搭建,具体的原理放在后面介绍.用过框架的朋友都知道要在WEB项目中使用一个 ...
- 转载 CSS3 经典教程系列:CSS3 盒阴影(box-shadow)详解
目标大纲 文章转载 CSS3 经典教程系列:CSS3 盒阴影(box-shadow)详解 IE中CSS-filter滤镜小知识大全 CSS实现跨浏览器兼容性的盒阴影效果
- jQuery实现侧边导航栏效果
效果图: 效果体验:http://keleyi.com/keleyi/phtml/jqmenu/2.htm 以下是完整代码: <!DOCTYPE html> <html> &l ...
- arcgis10.2.2地图服务切图具体步骤
1.未发布的参照http://www.cnblogs.com/oolili/p/4752114.html 2.在发布地图服务的基础上,打开Arccatalog,找到发布的地图服务选项,如下图: 右键地 ...
- ArcGIS API for Silverlight 使用GeometryService求解线与线的交点
///画线 void btn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Button btn = sender as B ...
- GCD
Grand Central Dispatch(GCD)包含语言特点.运行库和系统增强功能,它提供系统的.综合的改进,进而去支持并发代码在iOS和OSX多核硬件上的执行. 子系统.CoreFoundat ...
- HTML5-02 元素
概述 HTML 文档主要由元素组成,且主要分为两大部分:头部 和 主体.如图: 头部 概述 <head> 元素包含了所有的头部标签.<head> 元素中通常包含脚本(scrip ...
- MongoDB-常见问题
前言 MongoDB数据库的版本为3.0.7.记录在使用MongoDB数据库时遇到的各种问题,目前是遇到一个整理一个,没有进行分类,等整理较多的时候,进行分类整理一下. 1.使用可视化工 ...
- 整型信号量和PV操作(计算机操作系统)
在整型信号量机制中,信号量被定义为一个整形变量.除初始化外,仅能通过两个标准的原子操作Wait(S)和Signal(S)来访问.其通常分别被称为P.V操作. 描述如下: P操作:S=S-1:如果S小于 ...
- centos yum update kernel
1.查看当前kernel版本 uname -r 2.查看已安装版本 rpm -q kernel 3.查看可升级kernel版本 yum list kernel 4.升级kernel版本 yum upd ...