如何在git中编辑现有的标签消息? [英] How do I edit an existing tag message in git?

查看:107
本文介绍了如何在git中编辑现有的标签消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在git仓库中有几个注释标签。旧标签有伪造消息,我们希望更新为新样式。

 %git tag -n1 
v1.0消息
v1.1消息
v1.2消息
v2.0 2.0版建立于2011年10月15日。

在这个例子中,我们想让v1.x消息看起来像v2.0消息。任何人都知道我们会怎么做?

< tag name> ^ {} -f -m< new message>



这将创建一个新标签名称(通过覆盖原文)。

We have several annotated tags in our git repository. The older tags have bogus messages that we would like to update to be in our new style.

% git tag -n1
v1.0 message
v1.1 message
v1.2 message
v2.0 Version 2.0 built on 15 October 2011.

In this example, we would like to make v1.x messages look like the v2.0 message. Anyone know how we would do this?

解决方案

git tag <tag name> <tag name>^{} -f -m "<new message>"

This will create a new tag with the same name (by overwriting the original).

这篇关于如何在git中编辑现有的标签消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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