News for hackers. Stuff that matters.
Re:Key Git Concepts Explained the Hard Way by ythn on Wednesday March 14, 2018 @07:53PM (#16589427)
Same way strings in python are immutable yet still allow you to delete and recreate. Git repos are not blockchains
Re:Key Git Concepts Explained the Hard Way by sigjuice on Wednesday March 14, 2018 @08:36PM (#16589609)
I don't know enough about blockchains to understand the phrase git repos are not blockchains.

If I say git log 191edc5e2e515aab1075a3f0ef23599e80be5f59 anywhere at any time it means the same thing each and every time. That is not the case with git log v0.0.1

Re:Key Git Concepts Explained the Hard Way by avar on Thursday March 15, 2018 @03:03PM (#16595613)
The v0.0.1 is just a label for the tag object itself.

E.g. if you clone git.git you can see a tag for v2.16.2, the latest release. That you can re-create point to something entirely different.

But if you do:

    $ git rev-parse v2.16.2
    86aabcca24951ccfb9392014c8a379992434a7df
    $ git rev-parse v2.16.2^{commit}
    ffa952497288d29d94b16675c6789ef83850def3
You can see that the annotated tag object (GPG signature and all) is really called 86aabcca24951ccfb9392014c8a379992434a7df, and that it points to a commit ffa952497288d29d94b16675c6789ef83850def3.

That 86aabcca... is the immutable part of tags, just as commit objects are immutable.

Note that this only applies to annotated tags, lightweight tags just point to the commit object themselves, so they're really just a sort of branch name that git treats differently in not ever advancing it to another commit.