为什么git标记blob或树(或标签)? [英] Why git tag a blob or a tree (or a tag)?

查看:167
本文介绍了为什么git标记blob或树(或标签)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解如何使用git标记标记blob,树或甚至另一个带注释的标记。我了解使这成为可能的体系结构和概念设计。然而,我很难考虑这个(或真实工作流程应用程序)的实际应用程序。



在这里搜索堆栈溢出我只找到一个提到标记非提交对象的答案,建议不要这么做



可能的情况下,它有可能 适合标记一个非提交对象?

解决方案

标记树或blob可能适用于长期运行的实用程序直接操作对象。标记可确保 git gc 可以平行安全地运行。然后,实用程序会在完成时创建提交时删除标记。


I understand how it is possible to tag a blob, or a tree, or even another annotated tag, using a git tag. I understand the architecture and conceptual design that makes this possible.

However, I'm having trouble thinking of real life applications of this (or "real workflow" applications).

Searching here on Stack Overflow I only found one answer that mentions tagging non-commit objects, with advice not to do so.

Under what possible circumstances could it ever be appropriate to tag a non-commit object?

解决方案

Tagging trees or blobs may be appropriate temporarily in long-running utility programs that manipulate objects directly. Tagging would ensure that git gc can be safely run in parallel. The utility program would then remove the tags when it's done, when it's created a commit.

这篇关于为什么git标记blob或树(或标签)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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