|

Git Deleting Remote Tags from the Git Server

Git’s tags are convenient use to name some specific commits by tagging them for releasing or book keeping purposes. For example, GitHub allows repository managers to make releases using git tags. However, it may happen by mistake that a git tag is pushed to the remote git server while the tag has been made to a wrong commit, such as when a release tag is added the HEAD of a wrong branch. Under such cases, we may want to delete the remote git tag from the git server.

As a common practise, we assume the origin remote target is the remote git server target we would like to delete the remote git tag from.

Delete a Remote Git Tag from the Git Server

To delete a remote git tag TAG, run

git push --delete origin TAG

If the git repository uses the same name for some tags and branches (because git tags and branches are in different namespace and a tag and a branch can have the same name), use the full ref as follows.

git push --delete origin refs/tags/TAG

Note: after deleting the remote git tag, the locally cloned repository still has the tag. The local git tag can be removed by git tag -d TAG.

Example: Delete a Remote Git Tag v1.1.1

For example, to remove the tag v1.1.1, run

$ git push --delete origin v1.1.1

On success, git will print output as follows.

To github.com:user/repo
 - [deleted]         v1.1.1

Please note, the remote tag deletion operation is not a commit and this operation is not revertible.

Similar Posts

  • How to exclude users from GDM login screen?

    How to exclude users from appearing in the GDM login screen of Gnome 3? There is a long-time bug related to this ( https://bugzilla.redhat.com/show_bug.cgi?id=723708 ) which causes that the /etc/gdm/custom.conf has no effect. The closes workaround I find working on Fedora 20 is to totally disable listing of users (run as root): cat > /etc/dconf/db/gdm.d/01-mysettings…

  • How to operator[] access element in a const map in C++?

    How to operator[] access element in a const map in C++? For example, the compiler will report error on this piece of code: #include <iostream> #include <string> #include <map> std::int64_t count(const std::map<std::string, std::int64_t>& map) { return map[“one”] + map[“two”]; } int main () { std::map<std::string, std::int64_t> map = { {“one”, 1}, {“two”, 2} }; std::cout…

  • MFC程序使用系统风格界面

    VC6默认编译出来的程序在XP下Luma风格下运行也是Windows的经典界面, 有损界面的美观与统一. VC2008默认设置下如果不是使用的unicode也是如此. 本文给出使VC6和VC2008可以编译出使用系统界面风格的解决方案. 1. 使VC6编译出使用系统风格的程序 步骤如下: 1) 创建一个.manifest文件的资源. 在res/文件夹下创建一个跟以程序名加.manifest的文件, 如果程序为test.exe, 则创建test.exe.manifest 文件可由此下载: https://www.systutorials.com/t/g/programming/resultcollector.manifest/ 注意要使用utf-8编码保存。 2) 将新定义的资源加入到.rc2文件中, 类型设为24. 打开res/文件夹下的.rc2文件, 在其中加入如下定义: 1 24 MOVEABLE PURE “res/test.exe.manifest” 其中的文件地址按1)步中修改的设置即可. 之后编译即可, 为了使程序界面可能充分利用系统的界面特性, 可以将界面字体设置为TrueType类型的, 利用Windows XP等系统的屏幕字体平滑特性. 2. 使VC2008编译出使用系统风格的程序 在VC2008下就比较简单了, 如果程序字符集使用unicode则默认就是使用系统界面风格的, 如果选择其它的类型, 则编辑下stdafx.h即可. 最后面部分找到这么一段: #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,”/manifestdependency:”type=’win32′ name=’Microsoft.Windows.Common-Controls’ version=’6.0.0.0′ processorArchitecture=’x86′ publicKeyToken=’6595b64144ccf1df’ language=’*'””) #elif defined _M_IA64 #pragma comment(linker,”/manifestdependency:”type=’win32’…

  • Bash comparison operators

    What are all the bash supported comparison operators? The man 1 test contains all the operators supported in bash. An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and sets exit status. It is one of: ( EXPRESSION ) EXPRESSION is true ! EXPRESSION EXPRESSION is false EXPRESSION1 -a EXPRESSION2 both EXPRESSION1…

  • 一个非常优秀的MFC Grid控件

    使用MFC进行开发, 界面编程占用了很大部分的时间. 像Grid这样的控件, MFC并没有提供支持. 发现了这样一个GridCtrl控件, 非常好用: http://www.codeproject.com/KB/miscctrl/gridctrl.aspx 要开发类似的程序时可以采用. Read more: MFC程序使用系统风格界面 MFC中屏蔽ESC和回车关闭对话框 C++ Reference and Styles Git through SSH Tunnel as Proxy Profiling Vim to Find Out Which Plugin Makes Vim Slow How to Match Multiple Lines using Regex in Perl One-liners How to Install Go 1.13.x on Ubuntu 18.04 Converting Int to String in…

Leave a Reply

Your email address will not be published. Required fields are marked *