$ git push v5 v5/hotfix/5.1:hotfix/5.1-quartz
error: The destination you provided is not a full refname (i.e.,
starting with "refs/"). We tried to guess what you meant by:

- Looking for a ref that matches 'hotfix/5.1-quartz' on the remote side.
- Checking if the <src> being pushed ('refs/remotes/v5/hotfix/5.1')
is a ref in "refs/{heads,tags}/". If so we add a corresponding
refs/{heads,tags}/ prefix on the remote side.

Neither worked, so we gave up. You must fully qualify the ref.
hint: The <src> part of the refspec is a commit object.
hint: Did you mean to create a new branch by pushing to
hint: 'refs/remotes/v5/hotfix/5.1:refs/heads/hotfix/5.1-quartz'?
error: failed to push some refs to 'http://clu@172.31.212.149:8080/r/LISA/LISA_5.0.0.0.git'

根据下面的链接,进行调整。明确告知是push branch

$ git push v5 v5/hotfix/5.1:refs/heads/hotfix/5.1-quartz
Total 0 (delta 0), reused 0 (delta 0)
remote: Updating references: 100% (1/1)
To http://172.31.212.149:8080/r/LISA/LISA_5.0.0.0.git
* [new branch] v5/hotfix/5.1 -> hotfix/5.1-quartz

 

TL;DR

You probably wanted:

$ git push remote 51447424149c671958a2f76ec1fefb135a5c2cea:refs/heads/WIP-51447424149c671958a2f76ec1fefb135a5c2cea

to create a branch named WIP-51447424149c671958a2f76ec1fefb135a5c2cea. (Be sure you really want to create that name, as it's kind of unweildy. It's valid and there is no problem with it, it's just a heck of a thing to type in.)

Long

What Git is complaining about takes a little bit of explanation:

  • A branch name is a special form of reference.
  • A reference is a string starting with refs/. The familiar two kinds of references are branch names and tags. (More about this in just a moment.)
  • References can be abbreviated ... sometimes, but not always.
  • Sometimes (wherever it makes sense to Git) you can use a raw hash ID instead of a reference.
  • git push takes a refspec, which is a pair of references separated by a colon (and optionally the whole thing can be prefixed with a plus sign).

What you're doing with git push is using the (very long) refspec 51447424149c671958a2f76ec1fefb135a5c2cea:WIP-51447424149c671958a2f76ec1fefb135a5c2cea. The left side of this refspec is the source reference, and the right side is the destination reference.

The thing on the left side of the colon is clearly1 a hash ID. So this is making use of the special case where you can supply a hash ID instead of an actual reference (as long as that object actually exists in your Git repository).

The thing on the right side of the colon, though, is a name, not a hash ID. This is good since this is one of the places that Git requires a name. But it's also a problem, because the name WIP-something does not start with refs/.

Note that Git explicitly complains about that:

The destination ... nor begins with refs/

Before we get to the rest, let's mention branches and tags again. A branch name like master is short-hand for the reference refs/heads/master. A tag name like v1.2 is short-hand for the reference refs/tags/v1.2. Note that in both cases, these start with refs/. They go on to name which kind of reference we're using:

  • A branch name reference starts with refs/heads/.
  • A tag name reference starts with refs/tags/.

In other words, when we say that branches and tags are forms of references, we're saying that given a reference, you can look at what comes right after refs/ and figure out what kind of reference it is: refs/heads/ means "branch" and refs/tags/ means "tag". (If you see refs/remotes/, that means it's a remote-tracking name; and there are yet more special words that go after refs/, such as notes/ for git notes.)

We also said above that references can sometimes be abbreviated. That's the first part of what Git is complaining about here, though:

... neither matches an existing ref on the remote ...

You're allowed to leave out the refs/heads/ part, and have the other Git—the one that your Git is pushing-to—figure out that master really means refs/heads/master. But this only works if they already have a refs/heads/master. If you're trying to create a new branch, you must tell the other Git: I'd like you to create a new branch.

You do this by giving the full name of the reference: refs/heads/WIP-something, for instance. The fact that it starts with refs/heads/ tells the other Git: I'd like to create a branch name. If you send them refs/tags/WIP-something, you are telling them to create a new tag name.

Anyway, this is why you're getting the rather long complaint, with its two parts: "neither ... nor". So the solution is to send them the full name.


1What, isn't it obvious? :-) This reminds me of the professors who prove theorems by doing six transformations and then saying "the rest is obvious...".

The destination you provided is not a full refname (i.e., starting with "refs/")的更多相关文章

  1. LeetCode 1059. All Paths from Source Lead to Destination

    原题链接在这里:https://leetcode.com/problems/all-paths-from-source-lead-to-destination/ 题目: Given the edges ...

  2. OpenStack nova VM migration (live and cold) call flow

    OpenStack nova compute supports two flavors of Virtual Machine (VM) migration: Cold migration -- mig ...

  3. NRF51822之pstorage介绍

    This information applies to the following SoftDevices: S110, S120, S130, S310 Introduction Persisten ...

  4. IDisplayTransformation

    IDisplayTransformation Bounds Full extent in world coordinates. The Bounds property controls the ful ...

  5. Angular源代码学习笔记-原创

    时间:2014年12月15日 14:15:10 /** * @license AngularJS v1.3.0-beta.15 * (c) 2010-2014 Google, Inc. http:// ...

  6. 10 Go 1.10 Release Notes

    Go 1.10 Release Notes Introduction to Go 1.10 Changes to the language Ports Tools Default GOROOT &am ...

  7. Angularjs 源码

    /** * @license AngularJS v1.3.0-beta.15 * (c) 2010-2014 Google, Inc. http://angularjs.org function t ...

  8. angular.js中提供的基础方法

    angular.bind angular.callbacks angular.equals /* *Determines if two objects or two values are equiva ...

  9. Oracle Recovery 01 - 常规恢复之完全恢复

    背景:这里提到的常规恢复指的是数据库有完备可用的RMAN物理备份. 实验环境:RHEL6.4 + Oracle 11.2.0.4 DG primary. 一.常规恢复之完全恢复:不丢失数据 1.1 单 ...

随机推荐

  1. 洛谷P2414 阿狸的打字机 [NOI2011] AC自动机+树状数组/线段树

    正解:AC自动机+树状数组/线段树 解题报告: 传送门! 这道题,首先想到暴力思路还是不难的,首先看到y有那么多个,菜鸡如我还不怎么会可持久化之类的,那就直接排个序什么的然后按顺序做就好,这样听说有7 ...

  2. [py]处理文件的3个方法

    file处理的3个方法: f和f.readlines效果一样 # f.read() 所有行 -> 字符串 # f.readline 读取一行 -> 字符串 # f.readlines 所有 ...

  3. Kettle定时抽取两个库中的两个表到目标库SYS_OPLOG表

     A库a表(红色为抽取字段): 关联用户表: B库b表(红色为抽取字段): 关联用户表  C目标库SYS_OPLOG表(c表) 利用kettle抽取A库a表(具体名称见上图),B库b表的上面红色框起来 ...

  4. 最大流(EK)

    最大流 — Edmond Karp算法 Edmond Karp算法的大概思想: 反复寻找源点s到汇点t之间的增广路径,若有,找出增广路径上每一段[容量-流量]的最小值delta,若无,则结束. 在寻找 ...

  5. openstack 部署笔记--dashboard

    控制节点 # yum install openstack-dashboard # vim /etc/openstack-dashboard/local_settings OPENSTACK_HOST ...

  6. Hadoop集群安装-CDH5(3台服务器集群)

    CDH5包下载:http://archive.cloudera.com/cdh5/ 主机规划: IP Host 部署模块 进程 192.168.107.82 Hadoop-NN-01 NameNode ...

  7. IP设置-内置服务器-外置服务器

    HBulider 中 运行 -> 设置web服务器 -> 内置服务器将 127.0.0.1 换为局域网的ip,可以在局域网内所有电脑,手机上浏览页面.但是只能浏览html,php asp等 ...

  8. 使用Fiddler手机抓包https-----重要

    Fiddler不仅可以对手机进行抓包,还可以抓取别的电脑的请求包,今天就想讲一讲使用Fiddler手机抓包! 使用Fiddler手机抓包有两个条件: 一:手机连的网络或WiFi必须和电脑(使用fidd ...

  9. JSON—fastJSON

    FastJSON的简介和作用? 1:基于java实现的JSON解析器和生成器 2:将java对象序列化成JSON字符串 3:将JSON字符串反序列化得到java对象 (在服务端生成java是很麻烦的事 ...

  10. Verilog篇(四)时序模型

    时序模型:仿真器的时间推进模型,它反映了推进仿真时间和调度事件的方式. 1)门级时序模型:适用于分析所有的连续赋值语句,过程连续赋值语句,门级原语,用户自定义原语. 特点:任意时刻,任意输入变化都将重 ...