git push tag错误的含义:“删除不存在的引用". [英] meaning of git push tag error: "Deleting a non-existent ref."

查看:207
本文介绍了git push tag错误的含义:“删除不存在的引用".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对分支头进行一些更改后,我们需要移动release标签.当我尝试这样做时,我遇到了一个令人困惑的git错误消息,并要求有知识的人对此进行解释.我可以找到许多带有类似消息的网页,但是我看过的所有解释似乎都不适用.请避免就手册页中讨论的理智与疯狂方法告诫我,因为选择此方法有外部原因,这对本次讨论没有用.

我做了什么:

在本地和远程存储库中,我运行了"git tag -d Release_7_3_16"以删除现有标签.我本地存储库中的git push/pull说没有变化.本地或原始目录中的"git标签"显示该标签不存在.

然后在我的本地存储库中运行"git -f -a Release_7_3_16"(因为我已经坐在正确的分支上)以(在适当的更改下)重新创建标签.

我尝试使用"git push origin:refs/tags/Release_7_3_16"将标签推送到远程,但出现了此错误:

  remote:警告:删除不存在的引用.到/db/sds14/user2/cg_sandbox/depot/cg_sandbox.git/-[已删除]参考/标签/Release_c60_7_3_16 

这实际上是什么意思,因为我现在还没有删除任何内容?!?

解决方案

我尝试使用"git push origin:refs/tag/Release_7_3_16"将标签推送到远程

该语法-特别是:name 部分-意味着在遥控器上请删除".

来自远程的警告消息表示我首先没有这个名称".也就是说,您要求远程服务器(在本例中为 origin )删除 refs/tag/Release_7_3_16 ,它认为这是一个合理的请求,因此找到了 refs/tag/Release_7_3_16 ,发现它不存在.

这并不奇怪,因为标签位于 refs/tags/(复数标签")中,而不是 refs/tag/(单数标签")中./p>

关于在遥控器上移动标签,您可能需要阅读此答案.

After making some changes to the head of a branch, we need to move the release tag. When I tried to do so, I ran into a confusing git error message and ask for someone knowledgeable to explain it. I can find many web pages with similar messages, but none of the explanations I looked at seemed to apply. Please avoid admonishing me about the sane vs insane methods discussed in the man page as there are outside reasons why this method was chosen, which are not useful to this discussion.

What I did:

In the local and remote repository, I ran "git tag -d Release_7_3_16" to remove the existing tag. A git push/pull in my local repository said no changes. 'git tag' in either the local or origin directory showed the tag did not exist.

Then in my local repository I ran "git -f -a Release_7_3_16" (since I was already sitting on the correct branch) to (re-)create the tag at the proper change.

I attempted to push the tag to the remote with "git push origin :refs/tags/Release_7_3_16", but it gave this error:

remote: warning: Deleting a non-existent ref.
To /db/sds14/user2/cg_sandbox/depot/cg_sandbox.git/
 - [deleted]         refs/tags/Release_c60_7_3_16

What does this actually mean, as I am not deleting anything at this point?!?

解决方案

I attempted to push the tag to the remote with "git push origin :refs/tag/Release_7_3_16"

That syntax—specifically the :name part—means "please delete" on the remote.

The warning message from the remote means "I didn't have this name in the first place". That is, you asked the remote (origin, in this case) to delete refs/tag/Release_7_3_16, which it thought looked like a reasonable request, so it went to find refs/tag/Release_7_3_16 and discovered it does not exist.

This is not very surprising as tags live in refs/tags/ (plural "tags"), not refs/tag/ (singular "tag").

As for moving the tag on the remote, you may want to read over this answer.

这篇关于git push tag错误的含义:“删除不存在的引用".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆