Why git tag a blob or a tree (or a tag)?

前端 未结 2 1927
说谎
说谎 2021-01-12 15:36

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

2条回答
  •  萌比男神i
    2021-01-12 16:12

    Are there any use cases where it would be appropriate to tag a non-commit object?

    As you figured out. In a nutshell you should avoid non-commit tagging.

    Lets say for example that you have fixed a code (hot fix) and its part of a bigger commit

    Why?
    since it was committed like this and only later you figured out that you need only a single file.
    Now you want to mark the file (content) of this change without marking all the other content.

    Sample 2:
    You are going over the code trying to figure out which file caused a bug, to mark a single commit you can use a tag or a git note but to mark a single file you will use tag.

    And there can some other examples as well.


    The Linux kernel repository also has a non-commit-pointing tag object – the first tag created points to the initial tree of the import of the source code

提交回复
热议问题