I am trying to delete a tag in the remote. I get conflicting answers - "tag does not exist" and then "tag was deleted", but when I check, the tag is still there. There is a similar question here ( meaning of git push tag error: "Deleting a non-existent ref.")但在我的案例中没有帮助。 感谢
% git --version
git version 2.11.0
% git ls-remote 2>/dev/null | grep amirk|grep '\.72$'
68a1595db91fca0cc1fa24566e9e7173fcd05c5e refs/tags/Forked_branch_amirk/test-10.0.0.72
% git push origin :refs/tags/Forked_Branch_amirk/test-10.0.0.72
remote: warning: Deleting a non-existent ref.
To <my-remote-git-repo>
- [deleted] Forked_Branch_amirk/test-10.0.0.72
% git ls-remote 2>/dev/null | grep amirk|grep '\.72$'
68a1595db91fca0cc1fa24566e9e7173fcd05c5e refs/tags/Forked_branch_amirk/test-10.0.0.72
答案 0 :(得分:2)
“删除不存在的引用”表示它不存在,但git ls-remote
输出表明它 。此时有两个明显的选择:
push
与ls-remote
不同的服务器,例如,您已定义了单独的提取和推送网址,或者您当前的分支有origin
以外的远程设置后者似乎更有可能。要检查,请运行git config --get branch.$(git symbolic-ref --short HEAD).remote
,以确保当前分支的遥控器确实是origin
;如果是,请运行git remote show origin
或git remote show -n origin
。
答案 1 :(得分:1)
目前还不清楚为什么标准语法(git push origin:refs / tags / tagname)在我的系统上不起作用。 但是这里有一个可行的替代语法:
git push --delete origin Forked_branch_amirk/test-10.0.0.36