logoalt Hacker News

ziml77yesterday at 8:17 PM2 repliesview on HN

Seems like a sensible way to archive branches. It's not like a tag and branch are actually very different anyway, right? A tag is a pointer that always refers to the same commit while a branch is a pointer that follows commits forward. And for something that's archived, you don't need the pointer updating mechanism.


Replies

progvalyesterday at 8:26 PM

> A tag is a pointer that always refers to the same commit

It's not guaranteed not to change. The UI just makes it harder to update.

show 1 reply
paulddraperyesterday at 11:09 PM

Correct.

One is refs/heads/<name> and the other is refs/tags/<name>

Branches are expected to change. When a commit is authored, HEAD (the current branch) updates to that commit.

Tags are expected not to change (though they can).