标签和提交消息之间的区别 [英] Difference between tag and commit message

查看:67
本文介绍了标签和提交消息之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有人总是需要一条消息来提交更改,但是什么时候以及为什么我还需要标记一次提交呢?假设我进行了一些更改并使用

I understand one always needs a message for committing the changes but when and why do I need to also tag a commit? Let's say I made some changes and I commit using

git add -A
git commit -m "add feature 1"

现在

git tag -a -m "includes feature 1" v0.1

问题是什么时候有意义?

The question is when does this make sense.

推荐答案

在发布所生产软件的版本时,指定标签是很有意义的.

It would make sense to specify a tag when you release a version of the software you're producing.

然后您可以这样做:

git tag -a v1.0 -m "Release Version 1.0"

就像我提到的评论一样,每次提交后不必标记,就像您在帖子中提到的那样,如果您不想包含消息,则还可以创建轻量级标记.看起来像这样:

Like my comment mentioned, you do not have to tag after every commit, like you mention in your post, you can also create lightweight tags, if you don't want to include a message. This would look like:

git tag v1.0

希望这会有所帮助.

这篇关于标签和提交消息之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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