Re:Ask HN: What's the worst piece of software you use everyday?
by dreamcompiler on Sunday July 12, 2020 @01:52AM
(#23809191)
Ah. I get it. You're talking about using a new branch name as a tag for an existing commit. Thanks.
Recently, in explaining this to a colleague who's relatively new to git, I think the "aha" moment came in realising that if you rewrite the history leading to commit X, you're really making new commit Y in addition to the old commit X - you're not changing X in to Y. Leaving a branch pointing at X is enough that git will keep it around after the history rewriting, in case you decide to do something with it later.