码迷,mamicode.com
首页 > 其他好文 > 详细

git/egit 工具使用之——搞笑的引用名称 (funny refname)

时间:2014-12-13 21:54:17      阅读:413      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   io   ar   color   os   使用   sp   

      一直懒得把项目从svn切换到git的一个重要原因就是不会使用git. 最近觉得必须研究研究了,然后遇到了各种问题,也读了很多文章。

      本文讲讲关于 push tag 失败的问题——搞笑的引用名称。错误信息如下:

Repository git@git.oschina.net:wei.chou/GitUsageTest.git
funny refname
error: refusing to create funny ref ‘v2.1‘ remotely

      操作被拒绝。原因是 “v2.1” 不能作为引用名称

      Why?

      在 stackoverflow 上看到这样一段话:

        @ScubaSteve The Pro Git book can be useful here. It describes how refs work, and the Git User‘s Manualtalks about them too. Basically, all refs do is point at a commit. Branches are under refs/heads, tags are under refs/tags, and remotes go under refs/remotes. So refs/heads/workingBranch refers to a branch. –  jszakmeister Dec 11 ‘12 at 9:46????

      大概是说,branches 的引用名称必须在跟在 refs/heads/... 路径下,tags 的引用名称必须跟在 refs/tags/... 路径下,remotes 的引用名称必须跟在 refs/remotes/... 路径下。Why? No why. 硬性规定,可从 git 的源码 中看出端倪:

bubuko.com,布布扣

OK! So easy, 问题解决了。

至于不清楚 Git 组织结构的孩纸们,可参见 Git Book 中文版Git 对象模型 以及 Git 追踪分支


git/egit 工具使用之——搞笑的引用名称 (funny refname)

标签:des   style   http   io   ar   color   os   使用   sp   

原文地址:http://my.oschina.net/weichou/blog/355852

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!