2
On Git Refs (matklad.github.io)
top 1 comments
sorted by: hot top new old
[-] FizzyOrange@programming.dev 2 points 1 month ago

Git has a mutable map whose keys are strings, and whose values are content-addressed objects. The keys are conventionally formatted as file system paths

I used to think this too, but I think it's more accurate to say the keys are filesystem paths. Try creating branches foo and foo/bar. That would be fine if the keys were strings. I vaguely recall there was some effort to make that actually work, but it doesn't today.

Do you understand why is it origin master in one command, and origin/master in the other? I didn’t, until a few weeks ago!

I mean I understood that it was because Git has a terrible CLI, and... that is ultimately still the reason. There's no fundamental reason it couldn't have been consistent. It just isn't.

this post was submitted on 08 Oct 2026
2 points (100.0% liked)

Git

4842 readers
8 users here now

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

founded 3 years ago
MODERATORS